Joined: Sun Oct 24, 2004 8:53 pm Posts: 6 Location: Philadelphia, PA
|
I am using hibernate v 3.1.beta1 and Spring 1.2.6
While using hibernate's PostInsertEventListener I am having a double insert issue.
I have a saveAbc(Abc abc) method defined in a singleton service object and that has spring-transaction annotation
@Transactional(propagation = Propagation.REQUIRED)
There is a PostInsertEventListener setup that has following in its onPostInsert() method implementation. It calls another singleton service object's saveHistory(Object o) that has spring-transaction annotation
@Transactional(propagation = Propagation.REQUIRED)
What happens is - I see the INSERT statement twice logged by hibernate and due to unique id contsraint on db side, this fails. The INSERT seems to happen in batch and during an internal flush call it tries to commit all to database, when I see error.
Has anyone seen something like this? any clues??
Thanks in advance
|
|