Package bitronix.tm.utils

Examples of bitronix.tm.utils.Uid


        BitronixTransaction transaction = TransactionContextHelper.currentTransaction();
        if (transaction == null) {
            if (log.isDebugEnabled()) { log.debug("no current transaction, not adding " + xaStatefulHolder + " to shared connection map"); }
            return;
        }
        final Uid currentTxGtrid = transaction.getResourceManager().getGtrid();

        StatefulHolderThreadLocal threadLocal = statefulHolderTransactionMap.get(currentTxGtrid);
        if (threadLocal == null) {
            // This is the first time this TxGtrid/ThreadLocal is going into the map,
            // register interest in synchronization so we can remove it at commit/rollback
View Full Code Here


        class LocalVisitor implements XAResourceHolderStateVisitor {
            private boolean found;
            public boolean visit(XAResourceHolderState xaResourceHolderState) {
                // compare GTRIDs
                BitronixXid bitronixXid = xaResourceHolderState.getXid();
                Uid resourceGtrid = bitronixXid.getGlobalTransactionIdUid();
                if (log.isDebugEnabled()) { log.debug("NOT_ACCESSIBLE xa resource GTRID: " + resourceGtrid); }
                if (currentTxGtrid.equals(resourceGtrid)) {
                    if (log.isDebugEnabled()) { log.debug("NOT_ACCESSIBLE xa resource's GTRID matched this transaction's GTRID, recycling it"); }
                    found = true;
                }
View Full Code Here

        HashMap redundantGtrids = new HashMap();

        for (int i = 0; i < transactionTableModel.getRowCount(); i++) {
            JournalRecord tlog = transactionTableModel.getRow(i);
            if (tlog.getStatus() == Status.STATUS_COMMITTING) {
                Uid gtrid = tlog.getGtrid();
                if (gtrids.containsKey(gtrid)) {
                    java.util.List tlogs = (java.util.List) gtrids.get(gtrid);
                    tlogs.add(tlog);
                    redundantGtrids.put(gtrid, tlogs);
                }
View Full Code Here

        class LocalVisitor implements XAResourceHolderStateVisitor {
            private XAResourceHolderState latestEnlistedHolder;
            public boolean visit(XAResourceHolderState xaResourceHolderState) {
                if (xaResourceHolderState != null && xaResourceHolderState.getXid() != null) {
                    BitronixXid bitronixXid = xaResourceHolderState.getXid();
                    Uid resourceGtrid = bitronixXid.getGlobalTransactionIdUid();
                    Uid currentTransactionGtrid = currentTransaction.getResourceManager().getGtrid();

                    if (currentTransactionGtrid.equals(resourceGtrid)) {
                        latestEnlistedHolder = xaResourceHolderState;
                    }
                }
                return true// continue visitation
            }
View Full Code Here

        class LocalVisitor implements XAResourceHolderStateVisitor {
            private XAResourceHolderState latestEnlistedHolder;
            public boolean visit(XAResourceHolderState xaResourceHolderState) {
                if (xaResourceHolderState != null && xaResourceHolderState.getXid() != null) {
                    BitronixXid bitronixXid = xaResourceHolderState.getXid();
                    Uid resourceGtrid = bitronixXid.getGlobalTransactionIdUid();
                    Uid currentTransactionGtrid = currentTransaction.getResourceManager().getGtrid();

                    if (currentTransactionGtrid.equals(resourceGtrid)) {
                        latestEnlistedHolder = xaResourceHolderState;
                    }
                }
                return true// continue visitation
            }
View Full Code Here

            rwLock.readLock().unlock();
        }
    }

    public void putXAResourceHolderState(BitronixXid xid, XAResourceHolderState xaResourceHolderState) {
      Uid gtrid = xid.getGlobalTransactionIdUid();
      Uid bqual = xid.getBranchQualifierUid();
     
      rwLock.writeLock().lock();
        try {
          if (log.isDebugEnabled()) { log.debug("putting XAResourceHolderState [" + xaResourceHolderState + "] on " + this); }
            if (!xaResourceHolderStates.containsKey(gtrid)) {
View Full Code Here

            rwLock.writeLock().unlock();
        }
    }

    public void removeXAResourceHolderState(BitronixXid xid) {
      Uid gtrid = xid.getGlobalTransactionIdUid();
      Uid bqual = xid.getBranchQualifierUid();

        rwLock.writeLock().lock();
        try {
          if (log.isDebugEnabled()) { log.debug("removing XAResourceHolderState of xid " + xid + " from " + this); }
View Full Code Here

     */
    public boolean isParticipatingInActiveGlobalTransaction() {
        rwLock.readLock().lock();
        try {
            BitronixTransaction currentTransaction = TransactionContextHelper.currentTransaction();
            Uid gtrid = currentTransaction == null ? null : currentTransaction.getResourceManager().getGtrid();
            if (gtrid == null)
                return false;

            Map<Uid, XAResourceHolderState> statesForGtrid = xaResourceHolderStates.get(gtrid);
            if (statesForGtrid == null)
View Full Code Here

        this.toStringValue = precalculateToString();
        this.hashCodeValue = precalculateHashCode();
    }

    public BitronixXid(Xid xid) {
        this.globalTransactionId = new Uid(xid.getGlobalTransactionId());
        this.branchQualifier = new Uid(xid.getBranchQualifier());
        this.toStringValue = precalculateToString();
        this.hashCodeValue = precalculateHashCode();
    }
View Full Code Here

        Set<BitronixXid> freshlyRecoveredXids = new HashSet<BitronixXid>();
        for (Xid xid : xids) {
            if (xid.getFormatId() != BitronixXid.FORMAT_ID) {
                if (log.isDebugEnabled()) log.debug("skipping non-bitronix XID " + xid + "(format ID: " + xid.getFormatId() +
                     " GTRID: " + new Uid(xid.getGlobalTransactionId()) + "BQUAL: " + new Uid(xid.getBranchQualifier()) + ")");
                continue;
            }

            BitronixXid bitronixXid = new BitronixXid(xid);
View Full Code Here

TOP

Related Classes of bitronix.tm.utils.Uid

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.