Re: revertChanges method removed?

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Apr 19 2006 - 09:27:54 EDT

  • Next message: Bryan Lewis: "joint prefetching narrows result set"

    Chris,

    > I'm trying to figure out which one of the rollback methods is the
    > right one for me :)

    Since your code predates Cayenne 1.2-Beta, you can safely ignore the
    differences between 'rollbackChanges' and 'rollbackChangesLocally' -
    you can use either one with the same effect.

    > If I have multiple transactions running at the same time, and in one
    > of them a commit fails, will it roll back all the other transactions
    > too if I use rollbackChanges()?

    Both rollback operations "undo" the DataContext object changes. This
    has no effect on *transaction* in a J2EE sense (so a transaction may
    have to be rolled back separately - it depends on how you transaction
    support is setup). Still if you have multiple DataContext instances,
    rolling back one of them has no effect on others.

    To summarize - DataContext rollback sets persistent object properties
    back to their last known committed values and has no other side effects.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Apr 19 2006 - 09:28:21 EDT