Long key = page.getPageId();
// how much pages we have for this transaction
size = writes.size() * pageFile.getPageSize();
PageWrite write;
if (size > maxTransactionSize) {
if (tmpFile == null) {
tmpFile = new RandomAccessFile(getTempFile(), "rw");
}
long location = nextLocation;
tmpFile.seek(nextLocation);
tmpFile.write(data);
nextLocation = location + data.length;
write = new PageWrite(page, location, data.length, getTempFile());
} else {
write = new PageWrite(page, data);
}
writes.put(key, write);
}