Re: Rollbacks and Listeners

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Aug 09 2010 - 15:28:16 UTC

  • Next message: mr.abanjo: "Get PK value of a previously generated object"

    On Aug 9, 2010, at 6:08 PM, Bruno René Santos wrote:

    > I have been analyzing the behaviour of the commitChanges lifecycle
    > and inferred
    > that only when all database operations that are contained on the
    > current context
    > are successfully performed do the post... callbacks are called.

    Correct.

    > So if you have
    > like 4 inserts on the context and one of them raises an exception
    > (because
    > violates an unique constraint for example), none post-persist
    > callbacks for the
    > other 3 inserts is called. Is that correct?

    Correct. None of the post* callbacks will be invoked if transaction
    failed.

    Andrus



    This archive was generated by hypermail 2.0.0 : Mon Aug 09 2010 - 15:28:47 UTC