cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Gentry <>
Subject Re: Exception/rollback behavior question
Date Thu, 28 Apr 2011 17:38:28 GMT
Hi Dave,

When you do a dataContext.commitChanges() and an exception is thrown,
your DataContext (and all the objects it manages) is left unchanged.
No implicit rollback is done by Cayenne.  (You can do an explicit one
yourself in the exception handler if you like or try to re-commit or
inform the user of the error or whatever else makes sense for your


On Wed, Apr 27, 2011 at 4:58 PM, Dave Lamy <> wrote:
> In a clustered project of ours we are sometimes seeing Postgres throw a
> deadlock exception, most likely because two concurrent updates are trying to
> update related rows in different orders.  According to the Postgres docs,
> the "easy" thing to do in this case is to retry the transaction that threw
> the deadlock.  Question is, if I catch the deadlock exception and then
> recommit, are all of the modification states still intact?  Or is there an
> intrinsic rollback that occurs before I have a chance to retry the commit?
> Thanks in advance for your help--
> Dave Lamy

View raw message