Package bitronix.tm.journal

Examples of bitronix.tm.journal.TransactionLogRecord


            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);
                    updateJournal(xid.getGlobalTransactionIdUid(), uniqueName, Status.STATUS_COMMITTED);
                    commitCount++;
View Full Code Here


        HashMap gtrids = new HashMap();
        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

        int committed = 0;
        int active = 0;
        int unknown = 0;

        for (int i = 0; i < transactionTableModel.getRowCount(); i++) {
            TransactionLogRecord tlog = transactionTableModel.getRow(i);
            switch (tlog.getStatus()) {
                case Status.STATUS_ACTIVE:
                    active++;
                    break;
                case Status.STATUS_PREPARING:
                    preparing++;
View Full Code Here

    private void selectTLogMatchingSequence(TransactionTableModel transactionTableModel, int sequenceNumber, JTable table) {
        int startIndex = table.getSelectedRow() + 1;

        for (int i = startIndex; i < transactionTableModel.getRowCount(); i++) {
            TransactionLogRecord tlog = transactionTableModel.getRow(i);
            if (tlog.getSequenceNumber() == sequenceNumber) {
                selectTableRow(table, i);
                return;
            }
        }

        // if it is not found, search starting back at the beginning of the list up to where we previously started
        if (startIndex > 0) {
            for (int i = 0; i < startIndex; i++) {
                TransactionLogRecord tlog = transactionTableModel.getRow(i);
                if (tlog.getSequenceNumber() == sequenceNumber) {
                    selectTableRow(table, i);
                    return;
                }
            }
        }
View Full Code Here

    private void selectTLogMatchingGtrid(TransactionTableModel transactionTableModel, String gtrid, JTable table) {
        int startIndex = table.getSelectedRow() + 1;

        for (int i = startIndex; i < transactionTableModel.getRowCount(); i++) {
            TransactionLogRecord tlog = transactionTableModel.getRow(i);
            if (tlog.getGtrid().toString().equals(gtrid)) {
                selectTableRow(table, i);
                return;
            }
        }

        // if it is not found, search starting back at the beginning of the list up to where we previously started
        if (startIndex > 0) {
            for (int i = 0; i < startIndex; i++) {
                TransactionLogRecord tlog = transactionTableModel.getRow(i);
                if (tlog.getGtrid().toString().equals(gtrid)) {
                    selectTableRow(table, i);
                    return;
                }
            }
        }
View Full Code Here

        TransactionLogCursor tlis = new TransactionLogCursor(filename);

        int count=0;
        try {
            while (true) {
                TransactionLogRecord tlog = tlis.readLog(true);
                if (tlog == null)
                    break;
                if (!acceptLog(tlog))
                    continue;
                tLogs.add(tlog);
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);
                if (log.isDebugEnabled()) log.debug("committed dangling transaction with GTRID " + gtrid);
                committedGtrids.add(gtrid);

                Set participatingUniqueNames = filterParticipatingUniqueNamesInRecoveredXids(uniqueNames);

                if (participatingUniqueNames.size() > 0) {
                    if (log.isDebugEnabled()) log.debug("updating journal's transaction with GTRID " + gtrid + " status to COMMITTED for names [" + buildUniqueNamesString(participatingUniqueNames) + "]");
                    TransactionManagerServices.getJournal().log(Status.STATUS_COMMITTED, tlog.getGtrid(), participatingUniqueNames);
                }
                else {
                    if (log.isDebugEnabled()) log.debug("not updating journal's transaction with GTRID " + gtrid + " status to COMMITTED as no resource could be found (incremental recovery will need to clean this)");
                    committedGtrids.remove(gtrid);
                }
View Full Code Here

    }

    private String buildTlogsSequenceNumber(List tlogs) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < tlogs.size(); i++) {
            TransactionLogRecord tlog = (TransactionLogRecord) tlogs.get(i);
            sb.append(tlog.getSequenceNumber());
            if (i < tlogs.size() -1)
                sb.append(", ");
        }
        return sb.toString();
    }
View Full Code Here

        }
        return sb.toString();
    }

    private String buildTlogsGtrid(List tlogs) {
        TransactionLogRecord tlog = (TransactionLogRecord) tlogs.get(0);
        return tlog.getGtrid().toString();
    }
View Full Code Here

            showDetails();
        }
    }

    private void showDetails() {
        TransactionLogRecord tlog = ((TransactionTableModel)table.getModel()).getRow(table.getSelectedRow());
        new TransactionLogDialog(frame, tlog).setVisible(true);
    }
View Full Code Here

TOP

Related Classes of bitronix.tm.journal.TransactionLogRecord

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.