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:
This is fixed upstream in 4.2 branch by commit: https://github.com/hibernate/hibernate-orm/commit/6d4dd52f8d361116f53ab5139d2a0e772ccc8325 .
Verified. hibernate-core-4.2.19.Final is OK.
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.