cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <>
Subject Re: Error on BaseContext - object is modified when committed is expected
Date Mon, 24 Jan 2011 11:14:05 GMT

On Jan 24, 2011, at 1:04 PM, Bruno René Santos wrote:

> So the best way to do this is to keep my shared DataContext for reading and when I need
to change something I create a new DataContext, pass the object read to this new context (using
for instants an ObjectIdQuery) and commit on this new Context.

Correct. Or you can use ObjectContext.localObject(object.getObjectId(), null) to get a copy
of an object in another context.

> To refresh the read-only Context with the changes I will need to perform a new query?

Actually Cayenne should refresh it for you after peer context commit.

View raw message