openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: EntityExistsException While updating
Date Tue, 03 Jul 2007 17:27:14 GMT
This error occurs during commit, which causes a flush, which looks  
for cascade persist fields of dirty objects, which is where the  
duplicate is found.

Is it possible that the application assigned a detached instance into  
a cascade persist field and independently put the persistent instance  
into the cache via merge?

Craig

On Jul 3, 2007, at 10:09 AM, Marc Prud'hommeaux wrote:

> 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)
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message