|Existing managed object being inserted [message #547211]
||Thu, 15 July 2010 23:45
| Fericit Bostan
Registered: June 2010
I'm running in GlassFish 3.0.1 with EclipseLink 2.0.1 and Spring 3.0. I've got an EJB that is a WebService that has a create method on it which the client calls after retrieving an existing object from the service on a previous call. My code walks the object graph to identify the existing objects in the persistence store and performs lookups for those objects and then associates them to the objects that are to be inserted. All this work is performed within a transaction.|
I actually have two issues. The first is that two of the objects that are retrieved from the persistence store contain the same Id, but the EntityManager is returning two different instances of the entity.
The second issue, which is much bigger, is that one entity that is retrieved from the persistence store, EclipseLink is attempting to insert it into the database. This causes a Violation of a Unique constraint in the database, but why would EclipseLink be trying to insert an entity that it currently manages?
The attached link is to my GlassFish servers log file. I enabled logging on EclipseLink and the TransactionManager in hopes of trying to identify the issue.
Thanks for the help.
Powered by FUDForum
. Page generated in 0.01571 seconds