Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
daneshk authored Jun 14, 2024
2 parents a2fc926 + fa5eeaf commit aca8a4c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "sql"
version = "1.13.0"
version = "1.13.1"
authors = ["Ballerina"]
keywords = ["database", "client", "network", "SQL", "RDBMS"]
repository = "https://github.com/ballerina-platform/module-ballerina-sql"
Expand All @@ -15,11 +15,11 @@ graalvmCompatible = true
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "1.13.0"
path = "../native/build/libs/sql-native-1.13.0.jar"
version = "1.13.1"
path = "../native/build/libs/sql-native-1.13.1.jar"

[[platform.java17.dependency]]
path = "../test-utils/build/libs/sql-test-utils-1.13.0.jar"
path = "../test-utils/build/libs/sql-test-utils-1.13.1.jar"
scope = "testOnly"

[[platform.java17.dependency]]
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "sql-compiler-plugin"
class = "io.ballerina.stdlib.sql.compiler.SQLCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.13.0.jar"
path = "../compiler-plugin/build/libs/sql-compiler-plugin-1.13.1.jar"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "sql"
version = "1.13.0"
version = "1.13.1"
dependencies = [
{org = "ballerina", name = "file"},
{org = "ballerina", name = "io"},
Expand Down
26 changes: 26 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

### Changed

## [1.13.1] - 2024-06-12

### Changed
- [Clean resources after procedure call failure](https://github.com/ballerina-platform/ballerina-library/issues/6626)

## [1.13.0] - 2024-02-05

### Added
- Support for 2201.9.0 distribution

## [1.12.1] - 2024-06-12

### Changed
- [Clean resources after procedure call failure](https://github.com/ballerina-platform/ballerina-library/issues/6626)

## [1.12.0] - 2024-02-05

### Added
- Support for Cursor based result set retrieval in procedure calls

### Changed
- [Revert Accept escaped backtick as insertions in parameterised query](https://github.com/ballerina-platform/ballerina-standard-library/issues/2056)

## [1.11.2] - 2024-06-12

### Changed
- [Clean resources after procedure call failure](https://github.com/ballerina-platform/ballerina-library/issues/6626)

## [1.11.1] - 2023-10-16

### Changed
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=io.ballerina.stdlib
version=1.13.1-SNAPSHOT
version=1.13.2-SNAPSHOT

puppycrawlCheckstyleVersion=10.12.1
hikkariLibVersion=3.3.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import static io.ballerina.stdlib.sql.utils.Utils.getDefaultStreamConstraint;
import static io.ballerina.stdlib.sql.utils.Utils.getSqlQuery;
import static io.ballerina.stdlib.sql.utils.Utils.updateProcedureCallExecutionResult;
import static io.ballerina.stdlib.sql.utils.Utils.closeResources;

/**
* This class holds the utility methods involved with executing the call statements.
Expand Down Expand Up @@ -116,9 +117,9 @@ private static Object nativeCallExecutable(BObject client, BObject paramSQLStrin
return ErrorGenerator.getSQLApplicationError(
"SQL Client is already closed, hence further operations are not allowed");
}
Connection connection;
CallableStatement statement;
ResultSet resultSet;
Connection connection = null;
CallableStatement statement = null;
ResultSet resultSet = null;
String sqlQuery = null;
try {
sqlQuery = getSqlQuery(paramSQLString);
Expand Down Expand Up @@ -168,11 +169,14 @@ private static Object nativeCallExecutable(BObject client, BObject paramSQLStrin
procedureCallResult.addNativeData(RESULT_SET_COUNT_NATIVE_DATA_FIELD, resultSetCount);
return procedureCallResult;
} catch (SQLException e) {
closeResources(isWithinTrxBlock, resultSet, statement, connection);
return ErrorGenerator.getSQLDatabaseError(e,
String.format("Error while executing SQL query: %s. ", sqlQuery));
} catch (ApplicationError e) {
closeResources(isWithinTrxBlock, resultSet, statement, connection);
return ErrorGenerator.getSQLApplicationError(e);
} catch (Throwable th) {
closeResources(isWithinTrxBlock, resultSet, statement, connection);
return ErrorGenerator.getSQLError(th, String.format("Error while executing SQL query: %s. ", sqlQuery));
}
} else {
Expand Down

0 comments on commit aca8a4c

Please sign in to comment.