StaleObjectStateException « Transaction « JPA Q&A





1. Hibernate - StaleObjectStateException in query possible?    stackoverflow.com

Is it possible to get a StaleObjectStateException with Hibernate when you do the same query twice inside one tx if the result data of that query gets changed by a concurrent ...

2. How to overcome StaleObjectStateException in grails Service    stackoverflow.com

I've introduced a TransactionService that I use in my controllers to execute optimistic transactions. It should

  • try to execute a given transaction (= closure)
  • roll it back if it fails and
  • try it again ...

3. Hibernate (JPA): how to handle StaleObjectStateException when several object has been modified and commited    stackoverflow.com

Consider the scenario: A Db transaction envolving more than one row from different tables with versioning. For example: A shopLists and products. Where a shopList may contain products (with their amount in the shoplist) ...

4. Optimistic locking and org.hibernate.StaleObjectStateException:    stackoverflow.com

I'm just experimenting with Optimistic locking. I have the following class:

@Entity
public class Student {

    private Integer id;
    private String firstName;
    private String lastName;
 ...

5. Avoid StaleObjectStateException when deleting entity    stackoverflow.com

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

6. How to prevent StaleObjectStateException on Query.list()?    stackoverflow.com

I use Hibernate optimistic locks in my software (via @Version annotation). It works quite well, but sometimes I get StaleObjectStateException while trying to merely retrieve some objects from database. How can ...

7. Grails performance test error : org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction    stackoverflow.com

I'm preparing for performance tests and creating new test cases. So I was just testing one test case, running it on a server I can only access and I just got: org.hibernate.StaleObjectStateException: Row ...

8. StaleObjectStateException after tx-rollback in jboss    forum.hibernate.org

hi, we use hibernate 2 with jboss datasources. if there is a foreign-key conflict in the database while deleting some db-entries, jboss rolls back the transaction. in our application i put session.delete(query) in a try and session.flush() in a finally block. after rollback i get a StaleObjectStateException in session.flush(). can you help me to prevend this? greetings from berlin, daniel.

9. FYI: Handling concurrency errors (StaleObjectStateException)    forum.hibernate.org

Beginner Joined: Wed Nov 26, 2003 11:53 am Posts: 26 Location: Netherlands Hello all, I thought I'd share my experiences with the community: for a lot of issues there are only questions, but few answers in the forums... A StaleObjectStateException does not mean that there is something "wrong", it is a logical extension of optimistic locking. When a version check fails ...





10. Rollback 's problem after StaleObjectStateException    forum.hibernate.org

Hibernate version: 2.1.8 Mapping documents:

11. concurrent updates without StaleObjectStateException    forum.hibernate.org

I've set up versioning for my test application (I can see version number being increased after each updates) and I'm executing the following method in two threads : Code: public void run() { logger.trace("Thread ID : " + Thread.currentThread().getId()); Session session = hibertest.sessionFactory.openSession(); Transaction transaction = session.beginTransaction(); ...