Package bitronix.tm.journal

Examples of bitronix.tm.journal.JournalRecord


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


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

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

        for (int i = startIndex; i < transactionTableModel.getRowCount(); i++) {
            JournalRecord tlog = transactionTableModel.getRow(i);
            if (sequence.equals(tlog.getRecordProperties().get("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++) {
                JournalRecord tlog = transactionTableModel.getRow(i);
                if (sequence.equals(tlog.getRecordProperties().get("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++) {
            JournalRecord 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++) {
                JournalRecord 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) {
                JournalRecord tlog = tlis.readLog(true);
                if (tlog == null)
                    break;
                if (!acceptLog(tlog))
                    continue;
                tLogs.add(tlog);
View Full Code Here

    }

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

        }
        return sb.toString();
    }

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

            displayedRows = new ArrayList(tLogs);
        }
        else {
            List newDis = new ArrayList();
            for (int i = 0; i < displayedRows.size(); i++) {
                JournalRecord transactionLogRecord = (JournalRecord) displayedRows.get(i);
                if (transactionLogRecord.getGtrid().toString().equals(gtrid))
                    newDis.add(transactionLogRecord);
            }
            displayedRows = newDis;
        }
    }
View Full Code Here

    public TransactionTableCellRenderer() {
    }

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        Component component = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
        JournalRecord tlog = ((RawTransactionTableModel)table.getModel()).getRow(row);
        if (!tlog.isValid()) {
            if (isSelected)
                setBackground(table.getSelectionBackground());
            else
                component.setBackground(Color.RED);
        }
View Full Code Here

            int commitCount = 0;
            int rollbackCount = 0;
            for (BitronixXid xid : xids) {
                Uid gtrid = xid.getGlobalTransactionIdUid();

                JournalRecord tlog = (JournalRecord) 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

TOP

Related Classes of bitronix.tm.journal.JournalRecord

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.