FK violation in ValidityAuditStrategy when when flush mode is COMMIT

Description

After changing flush mode from auto to commit, I now get a foreign key constraint violation when an existing entity was modified.
It looks like ValidityAuditStrategy.perform() is not flushing the session when flush mode is set to commit. Therefore the revision entity is not present in the database when ValidityAuditStrategy tries to update REVEND.

Activity

Show:

Steve EbersoleJanuary 28, 2014 at 8:08 PM

I was not able to get the changes to apply cleanly to the 4.2 branch. But I applied to master and 4.3 branches. Thanks for working on this Lukasz.

Olivier SambourgJuly 31, 2013 at 12:15 PM
Edited

Same issue here, using Hibernate 4.2.0 and Spring Webflow 2 with Websphere 8 (using WebSphereExtendedJtaPlatform)
Webflow forces the FlushMode to MANUAL for non-transactional operations (as expected) and ValidityAuditStrategy sends an AutoFlush event prior to updating the previous RevisionEntity. The AutoFlush is ignored and no flush is performed, hence the FK constraint violation as the new RevisionEntity has not been inserted.

Using Tomcat (no JTA) the problem does not occur though.

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created May 14, 2013 at 10:19 AM
Updated February 27, 2014 at 6:35 PM
Resolved January 28, 2014 at 8:08 PM