Shawn Clowater commented on Bug HHH-7689

Pull request added at to add test:
https://github.com/hibernate/hibernate-orm/pull/397

The test is a bit different since I couldn't get my head wrapped around when the addToBatch() might actually blow an exception.

In the test, it inserted two entitites in a child session with a shared transaction. The first one is valid but the second blows a validation exception.

This came up in a case in our code where we are using a child session with a main session controlling the transaction with Oracle SavePoints (which is how I think Spring handles their nested trans support). I left that all out of the test as it is not entirely relevant.

I have a workaround for this (manually call the abort) but the core issue is that there is a bunch of handling for aborting a batch that is never called. Typically, one would just allow the exception to trickle out to the top, roll the trans back and toss the Session which would eventually release the batch but until that point the batch is still active.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira