From: Manik S. <msu...@jb...> - 2006-07-10 14:58:55
|
User: msurtani Date: 06/07/10 10:58:53 Modified: src/org/jboss/cache/interceptors TxInterceptor.java Log: merged in changes from 1.4.0 Revision Changes Path 1.50 +25 -18 JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java (In the diff below, changes in quantity of whitespace are not shown.) Index: TxInterceptor.java =================================================================== RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/TxInterceptor.java,v retrieving revision 1.49 retrieving revision 1.50 diff -u -b -r1.49 -r1.50 --- TxInterceptor.java 6 Jul 2006 16:57:07 -0000 1.49 +++ TxInterceptor.java 10 Jul 2006 14:58:53 -0000 1.50 @@ -703,20 +703,27 @@ } catch (Throwable e) { - log.error("Commit failed. Issuing a commit on the local tx to clear stale locks.", e); + log.warn("Commit failed. Clearing stale locks."); try { - tx.commit(); + cleanupStaleLocks(gtx); } - catch (Exception e2) + catch (Throwable e2) { - log.error("Unable to re-run commit again to clear locks", e2); + log.error("Unable to clear stale locks", e2); throw new RuntimeException(e2); } - throw new RuntimeException("Commit failed, marking tx to be rolled back.", e); + throw new RuntimeException("Commit failed.", e); } } + + private void cleanupStaleLocks(GlobalTransaction gtx) throws Throwable + { + TransactionEntry entry = txTable.get(gtx); + entry.releaseAllLocksLIFO(gtx); + } + /** * creates a rollback() MethodCall and feeds it to handleCommitRollback(); * @param gtx |