startTimestamp = TX.getTimestamp(_support.getReadBuffer());
commitTimestamp = TX.getCommitTimestamp(_support.getReadBuffer());
backchainAddress = TX.getBackchainAddress(_support.getReadBuffer());
if (recordSize < TX.OVERHEAD || recordSize > Transaction.TRANSACTION_BUFFER_SIZE + TX.OVERHEAD
|| type != TX.TYPE) {
throw new CorruptJournalException("Transaction record at " + addressToString(address)
+ " has invalid length " + recordSize + " or type " + type);
}
if (startTimestamp != item.getStartTimestamp()) {
throw new CorruptJournalException("Transaction record at " + addressToString(address)
+ " has an invalid start timestamp: " + startTimestamp);
}
if (backchainAddress == 0) {
if (address != item.getStartAddress()) {
throw new CorruptJournalException("Transaction record at " + addressToString(address)
+ " has an invalid start " + addressToString(item.getStartAddress()));
}
break;
}
chainedAddress.add(0, address);
address = backchainAddress;
}
listener.startTransaction(address, startTimestamp, commitTimestamp);
applyTransactionUpdates(_support.getReadBuffer(), address, recordSize, startTimestamp,
commitTimestamp, listener);
for (Long continuation : chainedAddress) {
address = continuation.longValue();
_support.read(address, TX.OVERHEAD);
recordSize = TX.getLength(_support.getReadBuffer());
if (recordSize < TX.OVERHEAD || recordSize > Transaction.TRANSACTION_BUFFER_SIZE + TX.OVERHEAD
|| type != TX.TYPE) {
throw new CorruptJournalException("Transaction record at " + addressToString(address)
+ " has invalid length " + recordSize + " or type " + type);
}
_support.read(address, recordSize);
applyTransactionUpdates(_support.getReadBuffer(), address, recordSize, startTimestamp,
commitTimestamp, listener);