Skip to content

Commit

Permalink
release 2.7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlauvlwj committed Feb 22, 2020
1 parent 3c7bb27 commit 8e194df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {

allprojects {
group = "me.liuwj.ktorm"
version = "2.7.1"
version = "2.7.2"
}

subprojects { project ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ interface SqlDialect {
sql: String,
args: List<ArgumentExpression<*>>
): Pair<Int, CachedRowSet> {
database.useTransaction { transaction ->
transaction.connection.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS).use { statement ->
database.useConnection { conn ->
conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS).use { statement ->
statement.setArguments(args)

val effects = statement.executeUpdate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ open class SQLiteDialect : SqlDialect {
sql: String,
args: List<ArgumentExpression<*>>
): Pair<Int, CachedRowSet> {
database.useTransaction(TransactionIsolation.SERIALIZABLE) { transaction ->
val effects = transaction.connection.prepareStatement(sql).use { statement ->
database.useConnection { conn ->
val effects = conn.prepareStatement(sql).use { statement ->
statement.setArguments(args)
statement.executeUpdate()
}
Expand All @@ -47,7 +47,7 @@ open class SQLiteDialect : SqlDialect {
database.logger.debug("Retrieving generated keys by SQL: $retrieveKeySql")
}

val rowSet = transaction.connection.prepareStatement(retrieveKeySql).use { statement ->
val rowSet = conn.prepareStatement(retrieveKeySql).use { statement ->
statement.executeQuery().use { rs -> CachedRowSet(rs) }
}

Expand Down

0 comments on commit 8e194df

Please sign in to comment.