-
Notifications
You must be signed in to change notification settings - Fork 697
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connection leak. #1167
Comments
What the tests don't show is that when using Spring transactionTemplate is used by itself, there is not a leak, and that the addition of Exposed is the cause of the leaking. Also, But if your test-results hold even when repeating each test the same number of time, then, since even in Can you address these matters in your otherwise excellent test repro? |
Updated tests to precisely indicate leak conditions. |
Additional debug logging:
|
We had the same issue in our project, everything worked for a small load, but when we did performance tests, connection leaks started to occur. We have created something like this to fix this: // this class is exposed as a bean
class TransactionOperations(datasource: Datasource) {
private val db = Database.connect(datasource)
operator fun <T> invoke(block: () -> T): T {
//exposed transaction
return transaction(..., db = db) { callback() }
}
} Since you don't use |
@neetkee , thank you very much for providing such a complex sample. Looks like I was able to debug and fix that tricky case. |
Hello, I'm is using some spring libraries, that call queries via jdbcTemplate and transactionTemplate. I have encountered a problem.
If exposed transactions are used with Spring transactionTemplate there is a connection leak.
Issue project: https://github.com/neetkee/exposed-jdbc-template-demo. You can just run tests to reproduce the problem.
Error:
The text was updated successfully, but these errors were encountered: