• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

<openjpa-1.0.3-SNAPSHOT-nonfatal store error> org.apache.openjpa.persistence.OptimisticLockException

 
Annu Vinayak
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using Open Jpa for the DB layer of my application, the database being DB2. I have a bean which saves data to a table. This works perfectly fine on my environment but when I deploy the very same EAR on a server machine, it gives me the optimistic lock exception.

I have tried restarting the DB but it doesnt work. I have searched the net and still have no clarity as to why it works in one env and not on the other.

Note: Both the environments have identical Database installations.

Any inputs / cues are welcome. I need to understand what I am doin wrong here!
 
Annu Vinayak
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the reason for this exception, the table which I was trying to update did not have any constraints defined on it, not even primary key. Accidently, the same data scripts had been run twice thus returning two rows for update.

I still dont know why Open Jpa should throw an OptimisticLockException, but that is what the issue was.

Thanks anyway!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic