@Override public void close() throws IOException { try { commitTransactions(); } finally { clearLock(); } }
@Override public void close() throws IOException { try { commitTransactions(); } finally { clearLock(); } }
/** * Will clear the lock, eventually suspending a running transaction to make sure the * release is immediately taking effect. */ public void clearLockSuspending() { Transaction tx = null; try { // if there is an ongoing transaction we need to suspend it if ((tx = tm.getTransaction()) != null) { tm.suspend(); } clearLock(); } catch (Exception e) { log.errorSuspendingTransaction(e); } finally { if (tx != null) { try { tm.resume(tx); } catch (Exception e) { throw new CacheException("Unable to resume suspended transaction " + tx, e); } } } }
/** * Will clear the lock, eventually suspending a running transaction to make sure the * release is immediately taking effect. */ public void clearLockSuspending() { Transaction tx = null; try { // if there is an ongoing transaction we need to suspend it if ((tx = tm.getTransaction()) != null) { tm.suspend(); } clearLock(); } catch (Exception e) { log.errorSuspendingTransaction(e); } finally { if (tx != null) { try { tm.resume(tx); } catch (Exception e) { throw new CacheException("Unable to resume suspended transaction " + tx, e); } } } }