JDBC connection issue

Are the best ways to diagnose the JDBC connection issue to our db? Our team has already tried to increase maxPoolSize but it's not helping. We're getting around 100 connection stuck in waiting when the issue happens. Our codebase is pretty big, so it's hard to go through all transactional calls, etc.. Any other things to try?
6 Replies
JavaBot
JavaBot2mo ago
This post has been reserved for your question.
Hey @Kale Vivi! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
dan1st
dan1st2mo ago
What exactly do you mean with waiting? If these are actually in use but the threads may be waiting on stuff/doing other stuff, you could try to create a thread dump and check that And if you want to diagnose connection leaks, you could maybe inject a JFR event to every connection that is started when the connection is obtained and stopped when the connection is closed - but idk whether that would work here Depending on the framework you are using, you might have some options for e.g. tracing which might include information on database connections also some connection pools support detection of connections that are open for too long and give you a stack trace of where you opened the connection
Madjosz
Madjosz2mo ago
On MySQL/MariaDB you can activate a slow query log if the problem are inefficient queries.
dan1st
dan1st2mo ago
Somehow this question gives me vibes of the problem being that the connections are there but not actually used for queries - but I could be wrong on that That "Somehow" is the "stuck in waiting" in the question but I'm not sure sure where that comes from
Madjosz
Madjosz2mo ago
Maybe there is some connection pool at work but the connections are not returned to the pool.
JavaBot
JavaBot2mo ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one. In case your post is not getting any attention, you can try to use /help ping. Warning: abusing this will result in moderative actions taken against you.

Did you find this page helpful?