openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <>
Subject Re: Optimistic locking exception while performing a delete
Date Wed, 01 Apr 2009 15:06:46 GMT

> OpenJPA intermittently gives the below exception 
*intermittently* worries me.
Post the domain classes Application+ApplicationMember with their mapping meta-data, and we
will take a look.


  I have the following code for delete

		public Object delete(Object object)throws Exception{
		Application application = null;
		Long applicationId = null; 
			long memberId = ((ApplicationMember)object).getApplicationMemberID();
			ApplicationMember member = entityManager.find(ApplicationMember.class, memberId);
			applicationId = member.getApplication().getApplicationId();
			application = new Application();

		catch (Exception e) {
		return application;

While performing the above operation, OpenJPA intermittently gives the below exception

Caused by: <openjpa-1.2.0-r422266:683325 nonfatal store error> org.apache.openjp
a.persistence.OptimisticLockException: An optimistic lock violation was detected
 when flushing object instance "" to the data store.  This indicate
s that the object was concurrently modified in another transaction.

And I have the following settings in my persistence.xml file

			<property name="openjpa.LockManager" value="pessimistic(VersionCheckOnReadLock=none,VersionUpdateOnWriteLock=none)"/>

Could some one please help me come out of this problem? I am posting after 2 days of hard
work googling all the forums. 


Pinaki Poddar            
OpenJPA PMC Member/Committer
JPA Expert Group Member
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message