lastXid = currentXid; xidBranchesPair.addBranch(new TransactionBranchInfoImpl(branchXid, name));
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }
public void onRecord(LogRecord plainlr) { XALogRecord lr = (XALogRecord) plainlr; short recordType = lr.type; XACommittingTx tx = lr.getTx(); if (recordType == LogRecordType.XACOMMIT) { byte[][] data = tx.getRecord(); assert data[0].length == 4; int formatId = bytesToInt(data[1]); byte[] globalId = data[1]; byte[] branchId = data[2]; Xid masterXid = xidFactory.recover(formatId, globalId, branchId); Recovery.XidBranchesPair xidBranchesPair = new Recovery.XidBranchesPair(masterXid, tx); recoveredTx.put(masterXid, xidBranchesPair); log.debug("recovered prepare record for master xid: " + masterXid); for (int i = 3; i < data.length; i += 2) { byte[] branchBranchId = data[i]; String name = new String(data[i + 1]); Xid branchXid = xidFactory.recover(formatId, globalId, branchBranchId); TransactionBranchInfoImpl branchInfo = new TransactionBranchInfoImpl(branchXid, name); xidBranchesPair.addBranch(branchInfo); log.debug("recovered branch for resource manager, branchId " + name + ", " + branchXid); } } else { if(recordType != LogRecordType.END_OF_LOG) { // This value crops up every time the server is started log.warn("Received unexpected log record: " + lr +" ("+recordType+")"); } } }