2 Replies Latest reply on Apr 4, 2008 5:34 AM by fatbatman

    XPOST - @PostPersist called before Transaction ends

    fatbatman Novice

      Original post at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=117709

      ---------------------------------------------------------------------

      I have a @PostPersist EntityListener which I expected to be called after the transaction is finished and the data is in the database, however this doesn't seem to be the case. The EntityListener is called before the transaction ends when the data is not yet in the database, meaning a rollback can occur after the EntityListener has been called.
      Is this the expected behaviour of PostPersist? if so it's rather confusing and I don't see how in practice it's different from @PrePersist?

      These threads touch on the issue also, but neither recieved an answer.

      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=74966
      http://www.jboss.com/index.html?module=bb&op=viewtopic&t=90397

      regards

      James