[CONJ-49] driver bypasses Hibernate statement tracking Created: 2013-07-01  Updated: 2013-09-05  Resolved: 2013-09-05

Status: Closed
Project: MariaDB Connector/J
Component/s: None
Affects Version/s: 1.1.2, 1.1.3
Fix Version/s: 1.1.4

Type: Bug Priority: Minor
Reporter: Jon Ellis Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 0
Labels: None


 Description   

The following is output to the log when the Maria DB Java Connector driver is used with Hibernate (in a JBoss environment):

WARN  [jdbc.internal.JdbcResourceRegistryImpl] HHH000387: ResultSet's statement was not registered

This happens because the Hibernate code attempts to track statement references via interceptors on the Connection.createStatement() Statement.close() methods. When the driver code is creating statements to satisfy metadata queries it works below the JDBC API level, and therefore bypasses the interceptor on the createStatement() call.

Unfortunately it's not easy for me to provide a reproduce for this issue, but i can provide more details if the issue isn't obvious.



 Comments   
Comment by Vladislav Vaintroub [ 2013-07-01 ]

Apart from the warning (which sounds like something that is Hibernate internal), is there anything that does not work?

Comment by Vladislav Vaintroub [ 2013-07-01 ]

And right, the issue is not obvious. If would be great to provide more details, best would be a code snippet . Thanks!

Comment by Jon Ellis [ 2013-07-02 ]

No, everything works as expected. This really is a minor issue. The warning is only disconcerting as it isn't output when using the MySQL Connector/J driver in the same environment.

I'll come back and provide more detail shortly.

Comment by Vladislav Vaintroub [ 2013-09-05 ]

The fix was to return null as ResultSet.getStatement() for all database metadata queries. Looking at Hibernate source, it seems the only way to avoid the warning

Generated at Thu Feb 08 03:12:47 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.