Return-Path: Delivered-To: apmail-incubator-cayenne-dev-archive@locus.apache.org Received: (qmail 97105 invoked from network); 30 Oct 2006 19:04:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2006 19:03:59 -0000 Received: (qmail 92338 invoked by uid 500); 30 Oct 2006 19:04:06 -0000 Delivered-To: apmail-incubator-cayenne-dev-archive@incubator.apache.org Received: (qmail 92322 invoked by uid 500); 30 Oct 2006 19:04:06 -0000 Mailing-List: contact cayenne-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-dev@incubator.apache.org Delivered-To: mailing list cayenne-dev@incubator.apache.org Received: (qmail 92313 invoked by uid 99); 30 Oct 2006 19:04:06 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Oct 2006 11:04:06 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [64.124.179.102] (HELO polatsk.objectstyle.org) (64.124.179.102) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 30 Oct 2006 11:03:50 -0800 Received: (qmail 1421 invoked from network); 30 Oct 2006 19:03:29 -0000 Received: from unknown (HELO ?zZ?????IPv6:::1?) (127.0.0.1) by localhost with SMTP; 30 Oct 2006 19:03:29 -0000 Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <20061030183513.0376d86d@localhost.localdomain> References: <20061015180335.7de0ab54@localhost.localdomain> <20061030183513.0376d86d@localhost.localdomain> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <2B7D1E4B-F168-4021-83F5-77FB0CAC461F@objectstyle.org> Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Re: Lifecycle Callback Date: Mon, 30 Oct 2006 14:03:28 -0500 To: cayenne-dev@incubator.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org > 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 >