Re: sync error with eclipselink [message #729637] |
Mon, 26 September 2011 12:53  |
Eclipse User |
|
|
|
not sure what part of your question is still open - eclipselink uses caching, you best look this up in the doco.
If you change the object returned by eclipselink you make the cached object dirty.
So you have at least two options - either work on a copy (clone) of the cached object and merge this back when the change is committed or work on the original and refresh if cancelled
hope this helps
W.
|
|
|
|
Re: sync error with eclipselink [message #730040 is a reply to message #729641] |
Tue, 27 September 2011 10:30  |
Eclipse User |
|
|
|
You are sharing an EntityManager which is essentially a transactional context - you are likely in an extended environment. The cache settings you have been using are for the shared cache, which is used between EntityManager instances, and does not affect individual EntityManagers which are required to keep managed entities in the cache until they are cleared.
As Wolfgang mentioned, you will either need to detach entities and merge them back in when you want to persist changes, or refresh the entities when needed. To detach the entities, either close the EntityManager and obtain a new one, or call clear on it. Your shared cache settings will then come into play when reading from an empty EntityManager.
Regards,
Chris
|
|
|
Powered by
FUDForum. Page generated in 0.03451 seconds