When a merge does not update? [message #1060076] |
Wed, 22 May 2013 18:45  |
Eclipse User |
|
|
|
A example:
Using primefaces, when I list a data in a dataTable with LazyDataModel and get a entity with LazyDataModel.getRowData(), I change values but nothing value is updated in EntityManager.merge().
A more strange is when I process a new request (with session or view JSF bean), the data can be updated in merge... (same entity, stored in session).
detach a entity not fix...
But if I get the data from EntityManager without get a entity from getRowData(), can be updated...
Other strange point is when I get a data with getRowData(), if I get a entity from entityManager from ID, the entity not be updated...
Sorry for my bad english, i'm brazilian...
|
|
|
|
Re: When a merge does not update? [message #1061736 is a reply to message #1060805] |
Mon, 03 June 2013 12:34   |
Eclipse User |
|
|
|
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.04606 seconds