Re: Rollbacks and Listeners

From: Mike Kienenberger (mkienen..mail.com)
Date: Mon Aug 09 2010 - 14:37:43 UTC

  • Next message: Joe Baldwin: "Re: Rollbacks and Listeners"

    On Mon, Aug 9, 2010 at 5:41 AM, Bruno René Santos <brunoren..olos.pt> wrote:
    > Im using cayenne on a banking system, where commits and rollbacks are critical.
    > I was thinking about using cayenne callbacks to include the creation of logs
    > during database operations. My doubt is what happens when there is a rollback on
    > the database during a transaction in terms of callbacks? Do all Pre... callbacks
    > are called but no Post.. callbacks? Is there any way to know on the callbacks
    > that the objects were rollbacked?

    As long as you create the audit records in the same transaction as the
    rest of the data, when the transaction is rolled back or committed,
    then the audit logs will be rolled back or committed. You should not
    have to do anything on a Post, only on a Pre.

    ============

    An old issue on auditing is here. Not sure how relevant it is for
    3.0 as I haven't used 3.0 yet.

    https://issues.apache.org/jira/browse/CAY-414

    Some newer threads on auditing:

    http://mail-archives.apache.org/mod_mbox/cayenne-dev/200902.mbox/%3CB82E356A-3B9B-4D40-B767-2F7C863AAF7..bjectstyle.org%3E

    Andrey posted one set of code for doing this here -- read through the
    whole thread.

    http://mail-archives.apache.org/mod_mbox/cayenne-user/200903.mbox/%3C3219fff70903240316o4644e474ia669ea819510ef9..ail.gmail.com%3E



    This archive was generated by hypermail 2.0.0 : Mon Aug 09 2010 - 14:46:35 UTC