openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Prud'hommeaux <mprud...@apache.org>
Subject Re: EntityExistsException While updating
Date Tue, 03 Jul 2007 17:09:22 GMT
Sreedhar-

It sounds like OpenJPA thinks that are are trying to call em.persist 
() on an instance of RoleDTO with id #5, but one has already been  
persisted. Is this possible?



On Jul 3, 2007, at 5:07 AM, Sreedhar S wrote:

> Hi,
>
> While updating using openJPA I get the following exception. What does
> An object of type with oid already exists? Is it trying to update the
> table in RoleDTO?? But in RoleDTO, I specified
> @Column(name = "ROLE_ID", insertable=false, updatable = false)
> @Column(name = "ROLE_NAME", insertable=false, updatable = false)
>
> Kindly help
>
> Caused by:
> <0.9.7-incubating nonfatal store error>
> org.apache.openjpa.persistence.EntityExistsException: An object of
> type "com.server.dao.user.RoleDTO" with oid
> "com.server.dao.user.RoleDTO-5" already exists in this context;
> another cannot be persisted.
> FailedObject: com.vormetric.server.dao.user.RoleDTO@298c298c
> 	at org.apache.openjpa.kernel.BrokerImpl.persist(BrokerImpl.java:2397)
> 	at org.apache.openjpa.kernel.SingleFieldManager.preFlushPC 
> (SingleFieldManager.java:757)
> 	at org.apache.openjpa.kernel.SingleFieldManager.preFlushPCs 
> (SingleFieldManager.java:732)
> 	at org.apache.openjpa.kernel.SingleFieldManager.preFlush 
> (SingleFieldManager.java:634)
> 	at org.apache.openjpa.kernel.SingleFieldManager.preFlush 
> (SingleFieldManager.java:559)
> 	at org.apache.openjpa.kernel.SingleFieldManager.preFlush 
> (SingleFieldManager.java:475)
> 	at org.apache.openjpa.kernel.StateManagerImpl.preFlush 
> (StateManagerImpl.java:2678)
> 	at org.apache.openjpa.kernel.PDirtyState.beforeFlush 
> (PDirtyState.java:37)
> 	at org.apache.openjpa.kernel.StateManagerImpl.beforeFlush 
> (StateManagerImpl.java:854)
> 	at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1903)
> 	at org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java: 
> 1863)
> 	at org.apache.openjpa.kernel.BrokerImpl.beforeCompletion 
> (BrokerImpl.java:1781)
> 	at org.jboss.tm.TransactionImpl.doBeforeCompletion 
> (TransactionImpl.java:1491)
> 	at org.jboss.tm.TransactionImpl.beforePrepare(TransactionImpl.java: 
> 1110)
> 	at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:324)


Mime
View raw message