Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

AlreadyLockedException: Failed to lock the record, another user holds the lock

Salman5Feb 9 2015 — edited Feb 15 2015

I created web-service client application using Jdeveloper 11.1.1.7 and deployed it on weblogic 10.3.6 on cluster consists of 3 servers. The application task is to fetch data from DB and push it to external server application continuously. Every thing seems to be fine and the applications is working. The problem is with some logs message on the three servers.

I can see the following stack from the servers:

oracle.jbo.AlreadyLockedException: JBO-26030: Failed to lock the record, another user holds the lock.[[

  at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1105)

  at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:567)

  at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8589)

  at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:6237)

  at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6756)

  at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6943)

  at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3301)

  at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3106)

  at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2108)

  at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2389)

  ........

It is clearly said that some other process is locking the record while the current process is trying to lock the same record. Again it obvious to tell that the same application is deployed on three different servers ( i.e. on the cluster) and each application is trying to do the same task parallelly in each three servers with in cluster.

Question: Is it healthy to ignore this error? or I need to solve it out?

I also checked this blog (Andrejus Baranovskis Blog: Optimistic and Pessimistic Locking in Oracle ADF BC) It explains the difference between the available locking type in application model (i.e. optimistic and pessimistic). Shall I change the locking mode in application module for the mentioned client application to be optimistic instead of pessimistic? Will this solve the issue? Is it correct to do that with the application behavior that explained.

This post has been answered by Timo Hahn on Feb 15 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2015
Added on Feb 9 2015
5 comments
4,315 views