[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5315?page=c...
]
Erik-Berndt Scheper commented on HHH-5315:
------------------------------------------
Well, I've tried to reproduce this using the Envers test suite, but failed (until
now). I have a few ideas why this might be the case. One suspect is the behaviour of the
transaction manager in the test suite (in the sense that its behavious is different from
an XA enabled JTA transaction manager). Does that make sense? Another suspect is that
I'm using JPA with a Spring persistence context.
Perhaps Envers is using the actionqueue in a way that was never intended?
I worked around the issue by adding an extra Spring AOP interceptor before the spring tx
interceptor. This extra inceptor does an extra flush and then everything works fine.
Another thing I tried was to add an extra transaction synchronization and add the flush
there, but to my surprise that did not work.
Anyway, I did succeed to reproduce this in an Eclipse project with a couple of open source
third party libraries. I could add that project to this issue with some extra info if this
helps.
Note: this issue also affects 3.5.3 and current trunk (3.6.0-snapshot).
AuditJoinTable rows are no longer flushed to the database
---------------------------------------------------------
Key: HHH-5315
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5315
Project: Hibernate Core
Issue Type: Bug
Components: envers
Affects Versions: 3.5.1, 3.5.2
Environment: JPA with extended persistence context
Reporter: Erik-Berndt Scheper
Assignee: Adam Warski
Priority: Minor
In Hibernate core 3.5.1 issue HHH-3543 was fixed by using
BeforeTransactionCompletionProcess instead of a transaction synchronization. I have found
that since this change, rows in AuditJoinTables are no longer flushed to the database.
(Envers 3.5.0 final works fine).
I can work around the issue by adding a manual entityManager.flush() or by setting the
flushmode to manual.
I have noticed that AuditProcess.java already executes a flush() statement, but this does
not seem to suffice. I believe this is caused by the fact that during the
doBeforeTransactionCompletion() extra WorkUnits are added to the hibernate ActionQueue
(PersistentCollectionChangeWorkUnit) which process the AuditJoinTables.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira