Skip to content

Commit

Permalink
check for field existence before trying to construct bridge
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsimpson committed Mar 1, 2024
1 parent 25386b2 commit 2fa1e47
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class StatementInstrumentation extends InstrumentationBuilder {
* information in that Statement to have the proper pool information and ensure that the check round trips will be
* observed appropriately.
*/
onType("org.postgresql.jdbc.PgConnection")
onTypesMatching(named("org.postgresql.jdbc.PgConnection").and(declaresField(named("checkConnectionQuery"))))
.bridge(classOf[PgConnectionIsAliveAdvice.PgConnectionPrivateAccess])
.advise(method("isValid"), PgConnectionIsAliveAdvice)

Expand Down

0 comments on commit 2fa1e47

Please sign in to comment.