cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan BĂ©lisle <jonathan.beli...@rcda.ca>
Subject Moving object between DataContext
Date Sun, 23 Jul 2006 13:37:15 GMT
Hi, here is my problem.

I have a DataObject da1 registered with DataContext dc1.
I perform modification on da1. It's persistence state becomes MODIFIED.

Now I want to move da1 to DataContext dc2 and keep it's state MODIFIED 
so that when I do dc2.commitChanges(); da1 get written to the database.

Using dc2.localObject(da1.getObjectId(), da1) doesn't work because it's 
set the persistence state to COMMITTED and loose
track of witch properties were modified.
Even if I do da1.setPersistanceState(PersistenceState.MODIFIED) after 
localObject() da1 does not get written to the database on the next 
commit because dc2 thinks that no properties were modified.

Anybody know how to do that, a workaround ?

Thanks in advance, Jonathan.





Mime
View raw message