示例#1
0
 private static void cleanStrandedTx(final CascadingTx txValue) {
   LOG.error(
       "Found stranded transaction: "
           + txValue.getRecord().getPersistenceContext()
           + " started at: "
           + txValue.getRecord().getStack());
   try {
     txValue.rollback();
   } catch (final Exception ex) {
     LOG.trace(ex, ex);
   }
 }
示例#2
0
 public static void removeTransaction(final CascadingTx tx) {
   final String txId = makeTxRootName(tx);
   txLog.remove(txStateThreadLocal.toString() + tx.getRecord().getPersistenceContext());
   txStateThreadLocal.get().remove(tx.getRecord().getPersistenceContext());
   if (txId.equals(txStateThreadLocal.get())) {
     for (final Entry<String, CascadingTx> e : txStateThreadLocal.get().entrySet()) {
       cleanStrandedTx(e.getValue());
     }
     txStateThreadLocal.get().clear();
     txStateThreadLocal.remove();
   }
 }
示例#3
0
 private static String makeTxRootName(final CascadingTx tx) {
   return txStateThreadLocal.toString() + tx.getRecord().getPersistenceContext();
 }