hibernate exception row was updated or deleted exception when we save answer

前端 未结 2 1872
攒了一身酷
攒了一身酷 2021-01-27 06:12

Here I am Providing the hibernate project code which throws the exception

Exception:

org.hibernate.StaleObjectStateException:Row was updated or deleted         


        
2条回答
  •  不要未来只要你来
    2021-01-27 06:46

    There are two things i learned with hibernate. First, if you save the same object multiple times rapidly you may have a StaleObjectStateException. This is due to versioning on the table. A simple solution is to disable it. You should consider locking too if your table is accessed by multiple threads: http://docs.jboss.org/hibernate/orm/4.0/devguide/en-US/html/ch05.html

提交回复
热议问题