[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2455) "Could not close a JDBC result set" output very often

Dirk Feufel (JIRA) noreply at atlassian.com
Mon Mar 5 05:07:33 EST 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2455?page=comments#action_26373 ] 

Dirk Feufel commented on HHH-2455:
----------------------------------

I just noted that this problem also causes another nasty ouput since batcher.hasOpenResources() falsely returns true there:

"forcing batcher resource cleanup on transaction completion; forgot to close ScrollableResults/Iterator?"

> "Could not close a JDBC result set" output very often
> -----------------------------------------------------
>
>          Key: HHH-2455
>          URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2455
>      Project: Hibernate3
>         Type: Bug

>   Components: core
>     Versions: 3.2.2
>     Reporter: Dirk Feufel
>     Priority: Minor

>
> Original Estimate: 1 hour
>         Remaining: 1 hour
>
> If you call this type of code (like the DbTimestampType class does), the AbstractBatcher outputs a warning "Could not close a JDBC result set". 
> The problem should be that closing the prepared statement internally also closes the associated result sets and the AbstractBatcher still has a reference to this result set.  
> One possible solution might be to provide an additional method 
> 	public void closeStatement(PreparedStatement ps, ResultSet rs); 
> (as already present for closeQueryStatement) in the AbstractBatcher allowing to close both in the right order. 
> PreparedStatement ps = null;
> try {
> 	ps = session.getBatcher().prepareStatement( timestampSelectString );
> 	ResultSet rs = session.getBatcher().getResultSet( ps );
> 	....
> } finally {
> 	if ( ps != null ) {
> 		session.getBatcher().closeStatement( ps );
> 	}
> }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira




More information about the hibernate-issues mailing list