KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > h2 > store > SessionState


1 /*
2  * Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
3  * Initial Developer: H2 Group
4  */

5 package org.h2.store;
6
7 public class SessionState {
8     int sessionId;
9     int lastCommitLog;
10     int lastCommitPos;
11     InDoubtTransaction inDoubtTransaction;
12     
13     public boolean isCommitted(int logId, int pos) {
14         if(logId != lastCommitLog) {
15             return lastCommitLog > logId;
16         }
17         return lastCommitPos >= pos;
18     }
19     
20     public String JavaDoc toString() {
21         return "sessionId:" + sessionId + " log:" + lastCommitLog + " pos:" + lastCommitPos + " inDoubt:" + inDoubtTransaction;
22     }
23 }
24
Popular Tags