File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes optimistic lock error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "optimistic lock error" Watch "optimistic lock error" New topic

optimistic lock error

Olga Bayok

Joined: Jan 08, 2013
Posts: 1
Hi, all
In my application login failes when I hit enter key and click button 'Login' immediately afterwards with this error
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [UserVO] with identifier [42]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [UserVO#42]
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(
at org.springframework.orm.hibernate3.SpringSessionSynchronization.translateException(
at org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(
at $Proxy173.login(Unknown Source)

I have read some information about this error, but in my case i don't know how i can fix this. Can you help me and show some example?

subject: optimistic lock error
Similar Threads
setting an object in session using Filter
Problem invoking filter
Managing Session in Application
Problem Struts : get checked multibox (Session/form/request)
Issue with saving pojo in a transactional wrapper