1 8 9 package com.sleepycat.je.txn; 10 11 import com.sleepycat.je.Database; 12 import com.sleepycat.je.DatabaseException; 13 import com.sleepycat.je.TransactionConfig; 14 import com.sleepycat.je.dbi.EnvironmentImpl; 15 16 19 public class AutoTxn extends Txn { 20 21 public AutoTxn(EnvironmentImpl env, TransactionConfig config) 22 throws DatabaseException { 23 24 super(env, config); 25 } 26 27 30 public void operationEnd(boolean operationOK) 31 throws DatabaseException { 32 33 if (operationOK) { 34 commit(); 35 } else { 36 abort(false); } 38 } 39 40 43 public void operationEnd() 44 throws DatabaseException { 45 46 operationEnd(true); 47 } 48 49 54 public void setHandleLockOwner(boolean operationOK, 55 Database dbHandle, 56 boolean dbIsClosing) 57 throws DatabaseException { 58 59 if (operationOK) { 60 if (!dbIsClosing) { 61 transferHandleLockToHandle(dbHandle); 62 } 63 unregisterHandle(dbHandle); 64 } 65 } 66 } 67 | Popular Tags |