00001
00002
00003
00004
00005
00006
00007
00008
00009 package com.sleepycat.db.internal;
00010
00011 import com.sleepycat.db.*;
00012 import java.util.Comparator;
00013
00014 public class DbTxn {
00015 private long swigCPtr;
00016 protected boolean swigCMemOwn;
00017
00018 protected DbTxn(long cPtr, boolean cMemoryOwn) {
00019 swigCMemOwn = cMemoryOwn;
00020 swigCPtr = cPtr;
00021 }
00022
00023 protected static long getCPtr(DbTxn obj) {
00024 return (obj == null) ? 0 : obj.swigCPtr;
00025 }
00026
00027 void delete() {
00028 if(swigCPtr != 0 && swigCMemOwn) {
00029 swigCMemOwn = false;
00030 throw new UnsupportedOperationException("C++ destructor does not have public access");
00031 }
00032 swigCPtr = 0;
00033 }
00034
00035 public void abort() throws DatabaseException {
00036 try {
00037 abort0();
00038 } finally {
00039 swigCPtr = 0;
00040 }
00041 }
00042
00043 public void commit(int flags) throws DatabaseException {
00044 try {
00045 commit0(flags);
00046 } finally {
00047 swigCPtr = 0;
00048 }
00049 }
00050
00051 public void discard(int flags) throws DatabaseException {
00052 try {
00053 discard0(flags);
00054 } finally {
00055 swigCPtr = 0;
00056 }
00057 }
00058
00059
00060
00061
00062
00063
00064 public boolean equals(Object obj)
00065 {
00066 if (this == obj)
00067 return true;
00068
00069 if (obj != null && (obj instanceof DbTxn)) {
00070 DbTxn that = (DbTxn)obj;
00071 return (this.swigCPtr == that.swigCPtr);
00072 }
00073 return false;
00074 }
00075
00076
00077
00078
00079
00080
00081 public int hashCode()
00082 {
00083 return ((int)swigCPtr ^ (int)(swigCPtr >> 32));
00084 }
00085
00086 void abort0() { db_javaJNI.DbTxn_abort0(swigCPtr); }
00087
00088 void commit0(int flags) { db_javaJNI.DbTxn_commit0(swigCPtr, flags); }
00089
00090 void discard0(int flags) { db_javaJNI.DbTxn_discard0(swigCPtr, flags); }
00091
00092 public String get_name() throws com.sleepycat.db.DatabaseException {
00093 return db_javaJNI.DbTxn_get_name(swigCPtr);
00094 }
00095
00096 public int id() throws com.sleepycat.db.DatabaseException { return db_javaJNI.DbTxn_id(swigCPtr); }
00097
00098 public void prepare(byte[] gid) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbTxn_prepare(swigCPtr, gid); }
00099
00100 public void set_timeout(long timeout, int flags) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbTxn_set_timeout(swigCPtr, timeout, flags); }
00101
00102 public void set_name(String name) throws com.sleepycat.db.DatabaseException { db_javaJNI.DbTxn_set_name(swigCPtr, name); }
00103
00104 }