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
Alec Strong committed Apr 15, 2021
1 parent 80a9cb0 commit 839b1c8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ 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 839b1c8

Please sign in to comment.