Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » How to catch Exception with PessimisticLock.LockNoWait(PessimisticLock LockNoWait Exception)
How to catch Exception with PessimisticLock.LockNoWait [message #1014227] Mon, 25 February 2013 07:04 Go to next message
Eclipse UserFriend
Hello,
i'm using EclipseLink with Pessimistic Lock:

String queryString = "SELECT sfc FROM mytable sfc WHERE sfc.id=:sfcid";
Query query = em.createQuery( queryString );
query.setHint(QueryHints.PESSIMISTIC_LOCK, PessimisticLock.LockNoWait);
query.setParameter("sfcid", id );
List<MyTable> resList = (List<MyTable>) query.getResultList();



When i try to access a row locked, i have org.eclipse.persistence.exceptions.TransactionException, how i can distinguish Lock cases from the others? Can i use "Instanceof" some class or other methods?

Thanks
Rafa
Re: How to catch Exception with PessimisticLock.LockNoWait [message #1014829 is a reply to message #1014227] Tue, 26 February 2013 09:51 Go to previous message
Eclipse UserFriend
Please include the exception stack trace you are getting. If the exception is being wrapped, you may need to use the caused by of the exception, or pout your try catch around the query execution.
Previous Topic:Logging differences between Toplink and EclipseLink
Next Topic:Does eclipselink support oracle database column type ordimage?
Goto Forum:
  


Current Time: Wed Jul 23 09:59:53 EDT 2025

Powered by FUDForum. Page generated in 0.07646 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top