Hmm any locking should be managed by hibernate - the audit entities are normal hibernate entities, read and written using the session.
What database and what tx isolation level are you using?
Thanks for the response Adam, since creating this issue we have also experienced intermittent AUD relationship issues with missing foreign keys.
We are using MySQL 5.1.52, no transaction isolation is currently being specified in the conf, do you think using the default could be the cause of our problems?
Thanks for your support on this.
hmm let's maybe tackle the problem one by one.
The default tx isolation in MySQL is REPEATABLE_READ (http://dev.mysql.com/doc/refman/5.0/en/set-transaction.html)
When exactly do you see the errors? Are you updating the same entity with different data concurrently? Or are these different entities? What are the foreign key problems that you see?
Btw., you are using InnoDB, right? Not the default MyISAM?
I can't imagine why there could be a situation where there's no audit entry with the revend null. When you insert a new audit entry, the previous one is updated (first), and only if this succeeds the new one, with a null revend, is persisted.