openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roger.keays" <roger.ke...@ninthavenue.com.au>
Subject @ElementDependent and cascade-delete
Date Thu, 19 Apr 2007 02:08:51 GMT

Hi there,

I have a list which is marked @ElementDependent and also CascadeType.ALL.
Adding and removing items from the list works fine, and those elements are
deleted from the database. When I try to delete the owning entity though, I
get the exception below.

I can delete the entity okay if I delete all the elements of the list first.
Am I doing something wrong? I get the same behaviour on 0.9.6 and 0.9.7.

Thanks,

Roger



<2|false|0.9.6-incubating>
org.apache.openjpa.persistence.OptimisticLockException: An
 optimistic lock violation was detected when flushing object instance 
 "figbird.users.entities.RoleMapping-figbird.users.entities.RoleMapping-5"
 to the data store. This indicates that the object was concurrently modified
in another
 transaction. FailedObject:
figbird.users.entities.RoleMapping-figbird.users.entities.RoleMapping-5

   
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flushInternal(PreparedStatementManagerImpl.java:96)
   
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl.flush(PreparedStatementManagerImpl.java:68)
   
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flushPrimaryRow(OperationOrderUpdateManager.java:159)
   
org.apache.openjpa.jdbc.kernel.OperationOrderUpdateManager.flush(OperationOrderUpdateManager.java:86)
   
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:86)
   
org.apache.openjpa.jdbc.kernel.AbstractUpdateManager.flush(AbstractUpdateManager.java:69)
   
org.apache.openjpa.jdbc.kernel.JDBCStoreManager.flush(JDBCStoreManager.java:511)
   
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:127)
   
org.apache.openjpa.datacache.DataCacheStoreManager.flush(DataCacheStoreManager.java:506)
   
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManager.java:127)
    org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:1927)
    org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:1825)
   
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1756)
   
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.java:76)
    org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1313)
   
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:863)
   
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.java:377)
    seamless.application.EntityDAO.deleteEntity(EntityDAO.java:66)
-- 
View this message in context: http://www.nabble.com/%40ElementDependent-and-cascade-delete-tf3604490.html#a10070525
Sent from the open-jpa-dev mailing list archive at Nabble.com.


Mime
View raw message