Re: lifecycle callbacks, order of execution

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed May 19 2010 - 12:54:00 UTC

  • Next message: Gary Jarrel: "Exception when caching a SelectQuery with prefetching [WAS: Caching]"

    On May 19, 2010, at 7:17 AM, Marcin Skladaniec wrote:

    > It assumes that the postPersist() on Painting is going to be invoked
    > after Artist. And this is what I see when I run this. But is there a
    > way of assuring the order of postPersist triggers ?

    No, the ordering of entities is undefined when callback is invoked
    (only the ordering of multiple callback methods on the same entity is
    guaranteed).

    One potential workaround is defining a DataMap level listener that can
    do multiple operations at once. Or use one callback method on one of
    the 2 entities to perform both operations.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed May 19 2010 - 12:54:31 UTC