01: /*
02: * Copyright 2004-2008 H2 Group. Licensed under the H2 License, Version 1.0
03: * (http://h2database.com/html/license.html).
04: * Initial Developer: H2 Group
05: */
06: package org.h2.log;
07:
08: /**
09: * The session state contains information about when was the last commit of a
10: * session. It is only used during recovery.
11: */
12: public class SessionState {
13: int sessionId;
14: int lastCommitLog;
15: int lastCommitPos;
16: InDoubtTransaction inDoubtTransaction;
17:
18: public boolean isCommitted(int logId, int pos) {
19: if (logId != lastCommitLog) {
20: return lastCommitLog > logId;
21: }
22: return lastCommitPos >= pos;
23: }
24:
25: public String toString() {
26: return "sessionId:" + sessionId + " log:" + lastCommitLog
27: + " pos:" + lastCommitPos + " inDoubt:"
28: + inDoubtTransaction;
29: }
30: }
|