]
Steve Ebersole resolved HHH-7193.
---------------------------------
Resolution: Fixed
Fix Version/s: 4.1.2
Transaction Rollback not clearing statement batch on Prepared
Statement causes issues with statement caching
------------------------------------------------------------------------------------------------------------
Key: HHH-7193
URL:
https://hibernate.onjira.com/browse/HHH-7193
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 4.1.1
Environment: Hibernate 4.1.1 and before
Any connection provider that allows statement caching (i.e. C3P0)
Reporter: Shawn Clowater
Assignee: Steve Ebersole
Fix For: 4.1.2
Time Spent: 0.45h
The AbstractBatchImpl closes the preparedStatement in a finally block but doesn't
call clear in the event of a rollback. This can leave the preparedStatment in a weird
state if any type of statement caching is being used.
The issue is easily fixed by adding a clearBatch() call to the statement prior to close.
I was previously working around this by implementing my own BatchingBatcherFactory in Hib
3 but the API changed forcing me to look at it again. I figured I might as well provide a
global fix.
I'll add a pull request once I get github sorted.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: