I'm trying to implement a hibernate event listener that inserts a new record every time a specific entity is updated, deleted or inserted. I've implemented a listener for post-insert, post-update, post-delete. Its a requirement that the new record is inserted in the same transaction as the one that originally triggered the update/deletion/insert.
The relevant section of my listener looks like this (similar for postInsert & postDelete):
The listener is triggered for each event, but it seems as though the AuditRecord is not saved when using an Oracle database. Using MySQL or HSQLDB works fine. So my guess is that it has something to do with the Oracle dialect?
I've attached a test case which demonstrates it failing (but you will need to connect to an Oracle DB ) Same result for Oracle XE and the full monty.
Oracle Database 10g Express Edition Release 10.2.0.1.0 and Oracle Database 11g Release 188.8.131.52.0
I forgot to mention that the database driver I was using was ojdbc 10.1.0.5.0 (and same with 10.2.0.5.0)
Anyway, I managed to get around this issue by using a PreInsertEventListener instead. In the pre insert stage I register a transaction synchronization to do the actual work (I still want it to happen post-insert). This seems to work.
In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.
If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.
Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!