Re: Lifecycle Callback

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Oct 30 2006 - 14:03:28 EST

  • Next message: Tore Halset (JIRA): "[JIRA] Created: (CAY-699) maven junit documentation"

    > Most of the callbacks are working now. But I can't seem to get the
    > prePersist method work as expected? PrePersist is never called,
    > although I
    > registered all the possible events. Do you have an idea?

    One thing to check - is your application using preInterceptor
    ObjectContext wrapper, or dataContext? It should be the former.

    Andrus

    On Oct 30, 2006, at 12:35 PM, Adrian Wiesmann wrote:
    > Hi Andrus
    >
    >> Your code is right, but an extra setup is needed - DataContext needs
    >> to be decorated in two callback interceptors. I haven't documented it
    >> yet, as we still need to come up with a more transparent procedure.
    >> But here is how I am doing it in my apps:
    >
    > Thanks for helping me out with this.
    >
    > I have one comment (for the log, perhaps others want to try that as
    > well).
    >
    >
    >> // build interceptor sitting between DD and DC - one interceptor can
    >> // be shared by multiple DataContexts.
    >> DataChannel postInterceptor = new DataChannelCallbackInterceptor();
    >> postInterceptor.setChannel(domain);
    >
    > There is no setChannel method on the DataChannel Interface. I guess
    > this
    > is a typo and should read like this?:
    >
    > DataChannelCallbackInterceptor postInterceptor = new
    > DataChannelCallbackInterceptor();
    >
    > Most of the callbacks are working now. But I can't seem to get the
    > prePersist method work as expected? PrePersist is never called,
    > although I
    > registered all the possible events. Do you have an idea?
    >
    > Thanks again,
    > Adrian
    >



    This archive was generated by hypermail 2.0.0 : Mon Oct 30 2006 - 14:03:57 EST