Skip to content

Connection does not close when using transaction #3687

@kancko

Description

@kancko

SQLDelight Version

1.5.4

Application Operating System

Android

Describe the Bug

I noticed that the connection does not close when using transactions.

After a little research I found that the implementation of ConnectionManager in JdbcDriver is overridden by JdbcSqliteDriverConnectionManager

https://github.com/cashapp/sqldelight/blob/cb699fcc19632a70deeb2930470bcf09db625a42/drivers/sqlite-driver/src/main/kotlin/app/cash/sqldelight/driver/jdbc/sqlite/JdbcSqliteDriver.kt#L58-L70

Thus every time a new transaction is opened by JdbcSqliteDriver the connection remains open after its completion.
So, in genereal the flow looks like this:

Does this mean that the user has to be responsible for closing the connection every time he uses a transaction?
What is the point of overriding the functionality of JdbcDriver by JdbcSqliteDriverConnectionManager?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions