Details
- 
    
Bug
 - 
    Status: Closed (View Workflow)
 - 
    
Major
 - 
    Resolution: Fixed
 - 
    1.1.7
 - 
    None
 - 
    None
 
Description
I noticed with Hibernate I sometimes get java.sql.SQLException: There is an open result set on the current connection, which must be closed prior to executing a query when retrieving a result, depending on the complexity of the entity I am loading. Apparently Hibernate is relying on the specified behavior of the Statement to implicitly close any open ResultSet when performing a new execution.
From JDBC Spec - 15.2.5 Closing a ResultSet Object
...
A ResultSet object is implicitly closed when
- The associated Statement object is re-executed
… 
I worked around this in a local branch with the following code:
| 
				 org.mariadb.jdbc.MySQLStatement  | 
		
					protected boolean execute(Query query) throws SQLException {
			 | 
		
					    synchronized (protocol) {
			 | 
		
					        if (protocol.activeResult != null) {
			 | 
		
					            protocol.activeResult.close();
			 | 
		
					        }
			 | 
		
					        // snip
			 | 
		
					    }
			 | 
		
					}
			 |