I am trying to use the event listeners in Hibernate 3.1 to log insert activity. I have created my own listerner that implements the PostInsertEventListener Interface and mapped it to the "post-insert" and, after this didn't work, to the "post-commit-insert" event type in my hibernate_config file.
The problem is that the onPostInsert function of my listener implementation is being called by Hibernate even when the insert fails due, for example, to a UK constraint violation on the DB
Is this the expected behavior? The Javadoc for the PostInsertEventListener only says "Called after inserting an item in the datastore". But, this doesn't seem correct.
I assume I'm missing something here. Can anyone help?
|