Re: How to receive Data Object Transaction Events

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Fri Oct 13 2006 - 09:49:34 EDT

  • Next message: Andrus Adamchik: "Re: How to use RelationshipQuery?"

    Hi Felipe,

    That's right - I was going to mention that.

    Also a note on the future direction - in Cayenne 3.0 a new callback
    mechanism will replace transaction events [1]. As far as I can tell,
    migration should be fairly straightforward.

    Andrus

    http://cwiki.apache.org/CAYDOC/lifecycle-callbacks.html

    On Oct 13, 2006, at 3:31 AM, DOMINGUEZ Felipe wrote:

    > Hello.
    >
    > I did find the solution.
    >
    > It is as simple as to enable event dispatching on the DataContext :-0
    >
    > context.setTransactionEventsEnabled(true);
    >
    > then it works as it says in the documentation.
    >
    > I post it in case some one is having the same silly problem in the
    > future.
    >
    > Cheers
    >
    > Felipe
    >
    >
    >
    > -----Original Message-----
    > From: DOMINGUEZ Felipe [mailto:Felipe.DOMINGUE..urocontrol.int]
    > Sent: Thursday 12 October 2006 19:16
    > To: cayenne-use..ncubator.apache.org
    > Subject: How to receive Data Object Transaction Events
    >
    >
    > Hello again.
    >
    >
    > I have another question, this time is regarding events.
    >
    > I am looking at DataObjectTransactionEventListener and by reading the
    > documentation added in the javadoc API I would understand that by
    > just
    > implementing this interface y any DataObject I would receive events
    > telling me when the object will be committed or when the object was
    > committed.
    >
    > ====================================
    > This interface declares methods that DataObject classes can
    > implement to
    > be notified about transactions of their DataContext. Note: explicit
    > registration with EventManager is not necessary, since the events are
    > simply forwarded by ContextCommitObserver; stricly speaking these
    > methods are just regular 'callbacks'. The event argument is passed
    > along
    > for convenience.
    > ====================================
    >
    >
    > but it don't manage to make it work, in fact I have not found any way
    > to get these events, no even registering the object with the
    > EventManager..
    >
    > Any help will be appreciated.
    >
    > cheers
    >
    > Felipe



    This archive was generated by hypermail 2.0.0 : Fri Oct 13 2006 - 09:50:01 EDT