|
Re: When a merge does not update? [message #1060805 is a reply to message #1060076] |
Tue, 28 May 2013 13:23 |
|
Ensure you are calling merge on the correct EntityManager that is in a transaction.
Check you merge cascading, you may be merging the same object twice, and only one of the copies may have your changes.
Print the objects data before and after calling merge to ensure it was merged correctly. Try calling flush() directly after the merge to see if the changes were picked up.
Enable logging on finest to see what is occurring, or try debugging.
Are you using field or property access? Be careful of side-affects in get/set method for property access.
If still having issues, include your code and log.
James : Wiki : Book : Blog : Twitter
|
|
|
Re: When a merge does not update? [message #1061736 is a reply to message #1060805] |
Mon, 03 June 2013 16:34 |
Everton Fujimoto Messages: 6 Registered: June 2012 |
Junior Member |
|
|
Hello, i'm already has make this... The problem, more detailed:
I'm using Java Server Faces 2.1 Mojarra, Primefaces 3.5, Glassfish 3.2.1.1, Eclipselink 2.4, EJB3 to control transactions and inject EntityManager's.
Using Primefaces LazyDataModel, i'm calling super.getRowData() to get entity to merge, this method find in LazyDataModel inner List the entity, retrieved in other request by TypedQuery (returning the List used from LazyDataModel) and when I get the data from that List, in same request, merge don't store the changes in this object... But, if I get the element (without get by LazyDataModel), directly from entitymanager, merge can update this element.
A very strange is the element, if I get a copy from LazyDataModel, and I get other copy from entityManager, nothing of copy's store with merge.
I think that List in LazyDataModel are a IndirectList from EntityManager, inserted in a LazyDataModel, does not detach the elements from EntityManager after out of the EJB scope (or the Request is finalized), and the changes "poison" the cache... I will make a project example to send here, but this week I have not time...
If is that I think, you know how I can solve? What you think it's?
|
|
|
|
Powered by
FUDForum. Page generated in 0.02941 seconds