question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HikariCP: connection.getMetaData().getUserName() fires with each JDBC call

See original GitHub issue

Using JDBC instrumentation, a SELECT USER( ) query is sent with each SQL statement, effectively doubling the number of SQL queries sent by the app.

Screenshot from Datadog APM dashboard, after turning on the java agent. The number of requests is equal to the total number of sql queries sent by the app. image

Looking into connection metrics, HikariCP is properly reusing connections from its pool, so the caching mechanism in [Prepared]StatementInstrumentation.java should kick in, and there should be only one SELECT USER( ) statement for each new connection created.

Play 2.6.13 (Scala), Slick 3.2.1, HikariCP 2.7.8

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
realarkcommented, Jul 10, 2018

Reopening. Will close this issue when the fix ships in the 0.11.0 release early next week.

1reaction
twbarbercommented, Jul 10, 2018

@gary-huang Also interested in a release with this issue resolved. We’ve turned off APM in the meantime.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HikariCP generate too many connection in every request in Java
I am using HikariCP-3.1.0.jar for managing the connection pool. But When I request to my Database, it generates new more connection in every...
Read more >
java.sql.DatabaseMetaData.getUserName java code examples
Returns the version number of this JDBC driver. getSchemas. Returns the schema names ordered by TABLE_CATALOG and TABLE_SCHEMA. getImportedKeys. Returns a list ...
Read more >
Preventing database connection leaks - Etleap Blog
Today I am going to write about database connection leaks. ... we use JDBC extensively, along with HikariCP to manage our database ...
Read more >
HikariConfig (HikariCP 2.4.6 API) - Javadoc.io
This property controls the maximum amount of time (in milliseconds) that a connection is allowed to sit idle in the pool. String ·...
Read more >
Beware of slow transaction callbacks in Spring
Hikari failing after 30 seconds may mean that all connections were actually ... We can't simply put jms.send() as the last statement in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found