[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-2455) "Could not close a JDBC result set" output very often
Florian Probst (JIRA)
noreply at atlassian.com
Tue Jan 10 02:28:10 EST 2012
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45052#comment-45052 ]
Florian Probst commented on HHH-2455:
-------------------------------------
I created a unit test using hibernate4 (see attachment). This test case calls frequently the DbTimestamp.seed() method and the memory usage seems to be constant. The test case came with a H2 database, but I ran it also against a Oracle 11g database with the same result.
Currently we are not planning to switch to hibernate 4 so a patch of the current 3.6.x series would be nice!
> "Could not close a JDBC result set" output very often
> -----------------------------------------------------
>
> Key: HHH-2455
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2455
> Project: Hibernate Core
> Issue Type: Bug
> Components: core
> Affects Versions: 3.2.2
> Reporter: Dirk Feufel
> Priority: Minor
> Attachments: hibernate4-test.zip, patch-for-3.6.4.patch
>
> Original Estimate: 1h
> Remaining Estimate: 1h
>
> 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.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list