Package bitronix.tm.utils

Examples of bitronix.tm.utils.Uid


        Set freshlyRecoveredXids = new HashSet();
        for (int i = 0; i < xids.length; i++) {
            Xid xid = xids[i];
            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


            int commitCount = 0;
            int rollbackCount = 0;
            Iterator it = xids.iterator();
            while (it.hasNext()) {
                BitronixXid xid = (BitronixXid) it.next();
                Uid gtrid = xid.getGlobalTransactionIdUid();

                TransactionLogRecord tlog = (TransactionLogRecord) danglingRecords.get(gtrid);
                if (tlog != null) {
                    if (log.isDebugEnabled()) log.debug("committing " + xid);
                    success &= RecoveryHelper.commit(xaResourceHolderState, xid);
View Full Code Here

        HashMap redundantGtrids = new HashMap();

        for (int i = 0; i < transactionTableModel.getRowCount(); i++) {
            TransactionLogRecord 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

        if (log.isDebugEnabled()) log.debug("found " + danglingRecords.size() + " dangling record(s) in journal");
        Iterator it = danglingRecords.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry = (Map.Entry) it.next();
            Uid gtrid = (Uid) entry.getKey();
            TransactionLogRecord tlog = (TransactionLogRecord) entry.getValue();

            Set uniqueNames = tlog.getUniqueNames();
            Set danglingTransactions = getDanglingTransactionsInRecoveredXids(uniqueNames, tlog.getGtrid());

            long txTimestamp = gtrid.extractTimestamp();
            if (log.isDebugEnabled()) log.debug("recovered XID timestamp: " + txTimestamp + " - oldest in-flight TX timestamp: " + oldestTransactionTimestamp);

            if (txTimestamp < oldestTransactionTimestamp) {
                if (log.isDebugEnabled()) log.debug("committing dangling transaction with GTRID " + gtrid);
                commit(danglingTransactions);
View Full Code Here

        this.globalTransactionId = globalTransactionId;
        this.branchQualifier = branchQualifier;
    }

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

                        " (GTRID size too long)");
            }

            byte[] gtridArray = new byte[gtridSize];
            randomAccessFile.readFully(gtridArray);
            Uid gtrid = new Uid(gtridArray);
            int uniqueNamesCount = randomAccessFile.readInt();
            Set uniqueNames = new HashSet();
            int currentReadCount = 4 + 8 + 4 + 4 + 1 + gtridSize + 4;

            for (int i=0; i<uniqueNamesCount ;i++) {
View Full Code Here

        while (statesForGtridIt.hasNext()) {
            XAResourceHolderState xaResourceHolderState = (XAResourceHolderState) statesForGtridIt.next();

            if (xaResourceHolderState != null && xaResourceHolderState.getXid() != null) {
                BitronixXid bitronixXid = xaResourceHolderState.getXid();
                Uid resourceGtrid = bitronixXid.getGlobalTransactionIdUid();
                Uid currentTransactionGtrid = currentTransaction.getResourceManager().getGtrid();

                if (currentTransactionGtrid.equals(resourceGtrid)) {
                    result = xaResourceHolderState;
                }
            }
        }
View Full Code Here

    }

    public void putXAResourceHolderState(BitronixXid xid, XAResourceHolderState xaResourceHolderState) {
        synchronized (xaResourceHolderStates) {
            if (log.isDebugEnabled()) log.debug("putting XAResourceHolderState [" + xaResourceHolderState + "] on " + this);
            Uid gtrid = xid.getGlobalTransactionIdUid();
            Uid bqual = xid.getBranchQualifierUid();

            if (!xaResourceHolderStates.containsKey(gtrid)) {
                if (log.isDebugEnabled()) log.debug("GTRID [" + gtrid + "] previously unknown to " + this + ", adding it to the resource's transactions list");

                Map statesForGtrid = new LinkedHashMap(4); // use a LinkedHashMap as iteration order must be guaranteed
View Full Code Here

    }

    public void removeXAResourceHolderState(BitronixXid xid) {
        synchronized (xaResourceHolderStates) {
            if (log.isDebugEnabled()) log.debug("removing XAResourceHolderState of xid " + xid + " from " + this);
            Uid gtrid = xid.getGlobalTransactionIdUid();
            Uid bqual = xid.getBranchQualifierUid();

            Map statesForGtrid = (Map) xaResourceHolderStates.get(gtrid);
            if (statesForGtrid == null) {
                log.warn("tried to remove unknown GTRID [" + gtrid + "] from " + this + " - Bug?");
                return;
View Full Code Here

     * @return true if start() has been successfully called but not end() yet <i>and</i> the transaction is not suspended.
     */
    public boolean isParticipatingInActiveGlobalTransaction() {
        synchronized (xaResourceHolderStates) {
            BitronixTransaction currentTransaction = TransactionContextHelper.currentTransaction();
            Uid gtrid = currentTransaction == null ? null : currentTransaction.getResourceManager().getGtrid();
            if (gtrid == null)
                return false;

            Map statesForGtrid = (Map) xaResourceHolderStates.get(gtrid);
            if (statesForGtrid == null)
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.