@Override public String getGtrid() { return resourceManager.getGtrid().toString(); }
@Override public String getGtrid() { return resourceManager.getGtrid().toString(); }
@Override public int hashCode() { return resourceManager.getGtrid().hashCode(); }
public int hashCode() { return resourceManager.getGtrid().hashCode(); }
private static boolean isInEnlistingGlobalTransactionContext(XAResourceHolder xaResourceHolder, BitronixTransaction currentTransaction) { boolean globalTransactionMode = false; if (currentTransaction != null && xaResourceHolder.getXAResourceHolderStatesForGtrid(currentTransaction.getResourceManager().getGtrid()) != null) { globalTransactionMode = true; } if (log.isDebugEnabled()) log.debug("resource is " + (globalTransactionMode ? "" : "not ") + "in enlisting global transaction context: " + xaResourceHolder); return globalTransactionMode; }
private static boolean isInEnlistingGlobalTransactionContext(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder, BitronixTransaction currentTransaction) { boolean globalTransactionMode = false; if (currentTransaction != null && xaResourceHolder.isExistXAResourceHolderStatesForGtrid(currentTransaction.getResourceManager().getGtrid())) { globalTransactionMode = true; } if (log.isDebugEnabled()) { log.debug("resource is " + (globalTransactionMode ? "" : "not ") + "in enlisting global transaction context: " + xaResourceHolder); } return globalTransactionMode; }
private static boolean isInEnlistingGlobalTransactionContext(XAResourceHolder<? extends XAResourceHolder> xaResourceHolder, BitronixTransaction currentTransaction) { boolean globalTransactionMode = false; if (currentTransaction != null && xaResourceHolder.isExistXAResourceHolderStatesForGtrid(currentTransaction.getResourceManager().getGtrid())) { globalTransactionMode = true; } if (log.isDebugEnabled()) { log.debug("resource is " + (globalTransactionMode ? "" : "not ") + "in enlisting global transaction context: " + xaResourceHolder); } return globalTransactionMode; }
private static boolean isInEnlistingGlobalTransactionContext(XAResourceHolder xaResourceHolder, BitronixTransaction currentTransaction) { boolean globalTransactionMode = false; if (currentTransaction != null && xaResourceHolder.getXAResourceHolderStatesForGtrid(currentTransaction.getResourceManager().getGtrid()) != null) { globalTransactionMode = true; } if (log.isDebugEnabled()) log.debug("resource is " + (globalTransactionMode ? "" : "not ") + "in enlisting global transaction context: " + xaResourceHolder); return globalTransactionMode; }
@Override public int compare(BitronixTransaction t1, BitronixTransaction t2) { Long timestamp1 = t1.getResourceManager().getGtrid().extractTimestamp(); Long timestamp2 = t2.getResourceManager().getGtrid().extractTimestamp(); int compareTo = timestamp1.compareTo(timestamp2); if (compareTo == 0 && !t1.getResourceManager().getGtrid().equals(t2.getResourceManager().getGtrid())) { // if timestamps are equal, use the Uid as the tie-breaker. the !equals() check above avoids an expensive string compare() here. return t1.getGtrid().compareTo(t2.getGtrid()); } return compareTo; } };
@Override public String toString() { return "a Bitronix Transaction with GTRID [" + resourceManager.getGtrid() + "], status=" + Decoder.decodeStatus(status) + ", " + resourceManager.size() + " resource(s) enlisted (started " + startDate + ")"; }
@Override public int compare(BitronixTransaction t1, BitronixTransaction t2) { Long timestamp1 = t1.getResourceManager().getGtrid().extractTimestamp(); Long timestamp2 = t2.getResourceManager().getGtrid().extractTimestamp(); int compareTo = timestamp1.compareTo(timestamp2); if (compareTo == 0 && !t1.getResourceManager().getGtrid().equals(t2.getResourceManager().getGtrid())) { // if timestamps are equal, use the Uid as the tie-breaker. the !equals() check above avoids an expensive string compare() here. return t1.getGtrid().compareTo(t2.getGtrid()); } return compareTo; } };
@Override public String toString() { return "a Bitronix Transaction with GTRID [" + resourceManager.getGtrid() + "], status=" + Decoder.decodeStatus(status) + ", " + resourceManager.size() + " resource(s) enlisted (started " + startDate + ")"; }
public String toString() { return "a Bitronix Transaction with GTRID [" + resourceManager.getGtrid() + "], status=" + Decoder.decodeStatus(status) + ", " + resourceManager.size() + " resource(s) enlisted (started " + startDate + ")"; }
private void fireAfterCompletionEvent() { // this TX is no longer in-flight -> remove this transaction's state from all XAResourceHolders getResourceManager().clearXAResourceHolderStates(); if (log.isDebugEnabled()) log.debug("after completion, " + synchronizationScheduler.size() + " synchronization(s) to execute"); for (Synchronization synchronization : synchronizationScheduler) { try { if (log.isDebugEnabled()) log.debug("executing synchronization " + synchronization + " with status=" + Decoder.decodeStatus(status)); synchronization.afterCompletion(status); } catch (Exception ex) { log.warn("Synchronization.afterCompletion() call failed for " + synchronization, ex); } } ManagementRegistrar.unregister("bitronix.tm:type=Transaction,Gtrid=" + resourceManager.getGtrid()); }
/** * Create a new transaction on the current thread's context. * @return the created transaction. */ private BitronixTransaction createTransaction() { BitronixTransaction transaction = new BitronixTransaction(); getOrCreateCurrentContext().setTransaction(transaction); inFlightTransactions.put(transaction.getResourceManager().getGtrid(), transaction); MDC.put(MDC_GTRID_KEY, transaction.getGtrid()); return transaction; }
/** * Create a new transaction on the current thread's context. * @return the created transaction. */ private BitronixTransaction createTransaction() { BitronixTransaction transaction = new BitronixTransaction(); getOrCreateCurrentContext().setTransaction(transaction); inFlightTransactions.put(transaction.getResourceManager().getGtrid(), transaction); MDC.put(MDC_GTRID_KEY, transaction.getGtrid()); return transaction; }