Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

DbTxn.java

00001 /* ----------------------------------------------------------------------------
00002  * This file was automatically generated by SWIG (http://www.swig.org).
00003  * Version 1.3.25
00004  *
00005  * Do not make changes to this file unless you know what you are doing--modify
00006  * the SWIG interface file instead.
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   /* package */ 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          * We override Object.equals because it is possible for the Java API to
00061          * create multiple DbTxns that reference the same underlying object.
00062          * This can happen for example during DbEnv.txn_recover().
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          * We must override Object.hashCode whenever we override
00078          * Object.equals() to enforce the maxim that equal objects have the
00079          * same hashcode.
00080          */
00081         public int hashCode()
00082         {
00083                 return ((int)swigCPtr ^ (int)(swigCPtr >> 32));
00084         }
00085 
00086   /* package */ void abort0() { db_javaJNI.DbTxn_abort0(swigCPtr); }
00087 
00088   /* package */ void commit0(int flags) { db_javaJNI.DbTxn_commit0(swigCPtr, flags); }
00089 
00090   /* package */ 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 }

Generated on Sun Dec 25 12:14:32 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2