01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.search.db;
07:
08: import com.sun.portal.search.rdm.*;
09: import com.sleepycat.db.*;
10:
11: public class BDBTxn extends RDMTransaction {
12:
13: static DbEnv dbenv = null;
14:
15: static void init(DbEnv db_env) {
16: dbenv = db_env;
17: }
18:
19: public BDBTxn(BDBTxn parent, int flags) throws RDMException {
20: try {
21: t = dbenv
22: .txn_begin(parent != null ? parent.t : null, flags);
23: } catch (DbException dbe) {
24: throw new RDMException(dbe);
25: }
26: }
27:
28: public void abort() throws RDMException {
29: try {
30: t.abort();
31: } catch (DbException dbe) {
32: throw new RDMException(dbe);
33: }
34: }
35:
36: public void commit(int flags) throws RDMException {
37: try {
38: t.commit(flags);
39: } catch (DbException dbe) {
40: throw new RDMException(dbe);
41: }
42: }
43:
44: public String id() throws RDMException {
45: return gid;
46: }
47:
48: public void prepare(byte[] gid) throws RDMException {
49: }
50:
51: public Object getNativeTxn() {
52: return t;
53: }
54:
55: private String gid = null;
56: private DbTxn t = null;
57:
58: }
|