cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Unchanged version of data object
Date Tue, 24 Sep 2013 06:15:54 GMT

On Sep 20, 2013, at 9:41 PM, Markus Reich <> wrote:

> Hi,
> is there a way to get a unchanged (original version) of a CayenneDataObject
> that is changed and not commited? Or does a rollback reload data from DB?
> regards
> Markus

Rollback reverts the changes without a DB trip. So a rollback will give you an unchanged version
(and the uncommitted changes will be gone forever). 

If you want to keep the changes, but still have a version of the same DataObject that represents
the DB state, you might create a second parallel ObjectContext and look up that object there.
There are also ways to pick at cached snapshot of the changed object.


View raw message