org.codehaus.activemq.store.bdbn
Class BDbHelper

java.lang.Object
  extended byorg.codehaus.activemq.store.bdbn.BDbHelper

public class BDbHelper
extends Object

Some helper factory methods for creating default configured Berkeley DB objects

Version:
$Revision: 1.1 $

Field Summary
static int TRANSACTION_FLAGS
           
 
Constructor Summary
BDbHelper()
           
 
Method Summary
static com.sleepycat.db.DbTxn commitTransaction(com.sleepycat.db.DbTxn transaction)
          Commit a transaction, throwing a JMSException if a failure occurs to avoid TRA rolling back
static com.sleepycat.db.DbEnv createEnvironment(File dir, boolean runRecovery)
           
static com.sleepycat.db.DbTxn createTransaction(com.sleepycat.db.DbEnv environment)
           
static com.sleepycat.db.DbTxn getTransaction()
           
static int getTransactionCount()
           
static com.sleepycat.db.Db open(com.sleepycat.db.DbEnv environment, String name, boolean isQueue)
           
static com.sleepycat.db.DbTxn popTransaction()
          Pops off the current transaction from the stack
static void pushTransaction(com.sleepycat.db.DbTxn transaction)
          Sets the current transaction, possibly including nesting
static void rollbackTransaction(com.sleepycat.db.DbTxn transaction)
          Rolls back the transaction, catching all exceptions as we only rollback if we are about to throw an exception anyways
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSACTION_FLAGS

public static final int TRANSACTION_FLAGS
Constructor Detail

BDbHelper

public BDbHelper()
Method Detail

createEnvironment

public static com.sleepycat.db.DbEnv createEnvironment(File dir,
                                                       boolean runRecovery)
                                                throws com.sleepycat.db.DbException,
                                                       FileNotFoundException
Throws:
com.sleepycat.db.DbException
FileNotFoundException

open

public static com.sleepycat.db.Db open(com.sleepycat.db.DbEnv environment,
                                       String name,
                                       boolean isQueue)
                                throws FileNotFoundException,
                                       com.sleepycat.db.DbException,
                                       JMSException
Throws:
FileNotFoundException
com.sleepycat.db.DbException
JMSException

getTransaction

public static com.sleepycat.db.DbTxn getTransaction()
Returns:
the current thread local transaction that is in progress or null if there is no transaction in progress

popTransaction

public static com.sleepycat.db.DbTxn popTransaction()
Pops off the current transaction from the stack


pushTransaction

public static void pushTransaction(com.sleepycat.db.DbTxn transaction)
Sets the current transaction, possibly including nesting


getTransactionCount

public static int getTransactionCount()

createTransaction

public static com.sleepycat.db.DbTxn createTransaction(com.sleepycat.db.DbEnv environment)
                                                throws com.sleepycat.db.DbException
Throws:
com.sleepycat.db.DbException

commitTransaction

public static com.sleepycat.db.DbTxn commitTransaction(com.sleepycat.db.DbTxn transaction)
                                                throws JMSException
Commit a transaction, throwing a JMSException if a failure occurs to avoid TRA rolling back

Parameters:
transaction -
Throws:
JMSException - if the transaction could not be committed

rollbackTransaction

public static void rollbackTransaction(com.sleepycat.db.DbTxn transaction)
Rolls back the transaction, catching all exceptions as we only rollback if we are about to throw an exception anyways

Parameters:
transaction -


Copyright © 2004-2005 Protique, Ltd.. All Rights Reserved.