Connection leak.
See original GitHub issueHello, 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:
Could not open JDBC Connection for transaction; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30005ms.
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after 30005ms.
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:309)
at org.jetbrains.exposed.spring.SpringTransactionManager.doBegin(SpringTransactionManager.kt:41)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.startTransaction(AbstractPlatformTransactionManager.java:400)
at
Omitted
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Detecting and Resolving Database Connection Leaks with ...
Take a look at this tutorial that demonstrates how you can find and remove connection leaks between your application and database in Java...
Read more >Connection Leak - Metawerx Java Wiki
A situation which occurs when a connection is opened, then forgotten about. This is known as a "leak", because each time it happens,...
Read more >How to solve database connection leaks? - IBM
The database connection leaks should be identified and fixed in the code. It can be accomplished by using the dbconnection watchdog logger.
Read more >Find Connection leak in Java application - Stack Overflow
If you need to find out leaks you can use profilers like yourkit or jprofiler which is able to track socket/jdbc leaks.
Read more >The best way to detect database connection leaks
A connection leak happens when a connection is acquired without ever being closed. When should connection leaks be detected? Every relational ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@neetkee , thank you very much for providing such a complex sample. Looks like I was able to debug and fix that tricky case. I copy-pasted your test-sample into Exposed project. I will try to release the fix by the end of the week
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:
Since you don’t use
@Transactional
annotation, you could try it to 😃