Synchronizing Cayenne state with DB?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Synchronizing Cayenne state with DB?

Gili
Hi,

        The documentation mentions that it is possible that when I modify the
DB state using raw SQL it might fall out of sync with the Cayenne memory
model. How then does one resync the two?

        I believe this is equivilent to Hibernate's session.flush()

Thanks,
Gili
--
http://www.desktopbeautifier.com/
Reply | Threaded
Open this post in threaded view
|

Re: Synchronizing Cayenne state with DB?

Andrus Adamchik


On Aug 27, 2005, at 6:52 PM, Gili wrote:
> Hi,
>
>     The documentation mentions that it is possible that when I  
> modify the DB state using raw SQL it might fall out of sync with  
> the Cayenne memory model. How then does one resync the two?

A number of ways depending on your use patterns. Create a new  
DataContext; rerun a select query; use DataContext.invalidateObjects()

Andrus