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

Reply via email to