Bug 1211402 - (6.4.z)HHH-9413 - NonBatchingBatch.addToBatch() calls statement.close() twice
Summary: (6.4.z)HHH-9413 - NonBatchingBatch.addToBatch() calls statement.close() twice
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.4.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: CR1
: EAP 6.4.2
Assignee: Gail Badner
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks: 1196113 1219165 1233408
TreeView+ depends on / blocked
 
Reported: 2015-04-13 22:24 UTC by Gail Badner
Modified: 2017-01-17 10:16 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
: 1233408 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Gail Badner 2015-04-13 22:24:49 UTC
Description of problem:

NonBatchingBatch.addToBatch() method calls jdbcCoordinator.release(Statement)) for each statement, which ultimately closes the statement. At the end of addToBatch(), releaseStatements() is called, which repeats the same operation for each statement.

Depending on the DB, an exception can be thrown when Hibernate tries to operate on the closed statement. This exception is ignored, but is logged for each statement, which can be very noisy.

This is a regression caused by:
https://bugzilla.redhat.com/show_bug.cgi?id=1111206
https://hibernate.atlassian.net/browse/HHH-9252

Version-Release number of selected component (if applicable):


How reproducible:
Reproduces using SQL Server 2008, also when using tomcat jdbc-pool (see HHH-8853) 

Steps to Reproduce:
1.
2.
3.

Actual results:

Exception is thrown, logged, and ignored.

Expected results:

There should be no exception. After releasing the statements, NonBatchingBatch.addToBatch(), should just clear the batch statements (rather than releasing them again). 


Additional info:

Comment 1 Gail Badner 2015-04-13 22:40:31 UTC
This is fixed upstream in 4.2 branch by commit: https://github.com/hibernate/hibernate-orm/commit/6d4dd52f8d361116f53ab5139d2a0e772ccc8325 .

Comment 6 hsvabek 2015-06-23 06:01:04 UTC
Verified.
hibernate-core-4.2.19.Final is OK.

Comment 7 Petr Penicka 2017-01-17 10:15:52 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.

Comment 8 Petr Penicka 2017-01-17 10:16:15 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


Note You need to log in before you can comment on or make changes to this bug.