StaleObjectstateException « Delete « JPA Q&A





1. StaleObjectStateException (Row was updated or deleted by...)    forum.hibernate.org

Hi Guys I ran into HibernateOptimisticLockingFailureException exception when trying to save task entity, which has a manny to one association to user entity, while running a Junit tests. I am experiencing no errors while saving user entity seperatly or when associated to other entities. This is the mapping class of task object Code: ...

2. StaleObjectstateException row was updated or deleted by ...    forum.hibernate.org

I am getting this exception in a controller of a web application based on spring framework using hibernate. I have tried many ways to counter this but could not resolve it. In the controller's method, handleRequestInternal, there are calls made to the database mainly for 'read', unless its a submit action. I have been using, Spring's Session but moved to getHibernateTemplate() ...

3. StaleObjectStateException when deleting objects    forum.hibernate.org

I am getting the following error when deleting multiple objects as part of a transaction: org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [xxx.Account#5864] at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1765) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2523) at org.hibernate.persister.entity.AbstractEntityPersister.delete(AbstractEntityPersister.java:2697) at org.hibernate.action.EntityDeleteAction.execute(EntityDeleteAction.java:74) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:146) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at com.ac.common.dao.jpa.BaseDAO.deleteAll(BaseDAO.java:77) at xxx.BaseAccountDAO.deleteAll(BaseAccountDAO.java:195) at xxx.TestDataFactory.deleteTestData(TestDataFactory.java:194) at ...

4. Avoid StaleObjectStateException when deleting entity    forum.hibernate.org

Hi all, I have 2 concurrent threads that at the same time enter a (Spring) transaction service. Using Hibernate, the service method loads some entities, processes those, finds one and deletes it from the DB. The pseudo code is as following: Code: @Transactional public MyEntity getAndDelete(String prop) { List list = (List)sessionFactory ...

5. StaleObjectStateException: Row was updated or deleted by....    forum.hibernate.org

i am using hibernate3 and having a problem with calling of store procedure. its working fine when i don't override the element in class to store procedure. whenever i override to {? = call updateCommonType(?, ?, ?) } this thorwing exception. StaleObjectStateException: row was updated or deleted by another transactions.................. . .. .. . . .. . . .. anyone ...

6. StaleObjectStateException when deleting from one-to-many    forum.hibernate.org

Author Message richiecrakk Post subject: StaleObjectStateException when deleting from one-to-many Posted: Sun Feb 04, 2007 8:47 am Newbie Joined: Tue Jan 23, 2007 4:58 am Posts: 4 Hi, I am writing some JUnit test cases. I have a two one-to-many relationships across 3 tables and i am trying to delete a StaffData object from a table which in-turn i ...