| How to catch Exception with PessimisticLock.LockNoWait [message #1014227] |
Mon, 25 February 2013 07:04  |
Rafa Marcello Messages: 1 Registered: February 2013 |
Junior Member |
|
|
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
|
|
|
|
Powered by
FUDForum. Page generated in 0.09353 seconds