Skip to content

Commit

Permalink
Check that autocommit is set to true before beginning a transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
AlecKazakova committed Apr 15, 2021
1 parent 861488d commit 2c02edb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ abstract class JdbcDriver : SqlDriver, ConnectionManager {
}

override fun Connection.beginTransaction() {
check(autoCommit) { """
Expected autoCommit to be true by default. For compatibility with SQLDelight make sure it is
set to true when returning a connection from [JdbcDriver.getConnection()]
""".trimIndent()
}
autoCommit = false
}

Expand Down

0 comments on commit 2c02edb

Please sign in to comment.