Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7F652D2A8 for ; Tue, 5 Mar 2013 15:43:42 +0000 (UTC) Received: (qmail 19877 invoked by uid 500); 5 Mar 2013 15:43:42 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 19612 invoked by uid 500); 5 Mar 2013 15:43:40 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 19569 invoked by uid 99); 5 Mar 2013 15:43:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Mar 2013 15:43:38 +0000 X-ASF-Spam-Status: No, hits=1.7 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dscheibe79@googlemail.com designates 209.85.223.172 as permitted sender) Received: from [209.85.223.172] (HELO mail-ie0-f172.google.com) (209.85.223.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Mar 2013 15:43:34 +0000 Received: by mail-ie0-f172.google.com with SMTP id c10so8028455ieb.31 for ; Tue, 05 Mar 2013 07:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=uZg2vWfiuoIVNvtMAWPvyC1MXuTE2eFzk66nC9edkIo=; b=zT31WM0BobGoaFdA28J+3GWyLdfLZ3D8SYJdIR+H0csW3bJnK/ti3KAyUrWsEELZ8s +xFS8bHgFIqXKJxLIZrI6YZqPFpVMP8E5AIk78H/b75D/jauUU7BPiYptjD7zX2e3rN5 aoFbESIPlmWctkyR46xaO/LMSNov7kiJOgW832XGRxnBzJ1k7YNI+kfnEaqti8nQGasH xw1mhOWYGk5FfLzhaAqwuv5JEEizkNs2wFu7JjUeTVMudU/u8vxmP0yt4ZnXvjGDXrpU 73rGbeZkZBwr/gdj/at1wkxQdsyEC0kxMfHDvLlxNyKtzFbNKymiTOkRH67nxSgjqwDO lpcw== MIME-Version: 1.0 X-Received: by 10.50.212.105 with SMTP id nj9mr6534034igc.17.1362498194099; Tue, 05 Mar 2013 07:43:14 -0800 (PST) Received: by 10.64.16.100 with HTTP; Tue, 5 Mar 2013 07:43:13 -0800 (PST) Date: Tue, 5 Mar 2013 16:43:13 +0100 Message-ID: Subject: Lifecycle Listeners / cayenne-3.1B1 From: Daniel Scheibe To: user@cayenne.apache.org Content-Type: multipart/alternative; boundary=14dae93404a3ddd9c404d72f54ae X-Virus-Checked: Checked by ClamAV on apache.org --14dae93404a3ddd9c404d72f54ae Content-Type: text/plain; charset=ISO-8859-1 All, i'm trying to get the lifecycle listeners working for my use case and i've come accross a problem. I registered a listener to do some extra stuff for an entity whenever it will be persisted (prePersist) via: callbackRegistry.addListener(LifecycleEvent.PRE_PERSIST, Content.class, "prePersist"); This get's called as expected and works smoothly. Now whenever i have the scenario of a CommitException thrown during commitChanges() (for whatever reason, underlying database not available, etc.) i need to revert some of the stuff i did in the "prePersist" lifefycle callback on the object in question. Unfortunately i haven't had luck yet to register a lifecycle listener that will be called in case of a "rollback" through "rollbackChanges". The documentation states something about "PostLoad" being called "Within "ObjectContext.rollbackChanges()" after the object is reverted." (although this is from 3.0 i guess it should still apply? https://cayenne.apache.org/docs/3.0/lifecycle-callbacks.html) Is there any chance to get a kind of a "postRollback" lifecycle callback working or something similar? Or did i just hit a bug with the version i'm using? Any help is much appreciated. Cheers, Daniel --14dae93404a3ddd9c404d72f54ae--