com.sleepycat.je
Class DatabaseUtil

java.lang.Object
  extended bycom.sleepycat.je.DatabaseUtil

class DatabaseUtil
extends Object

Utils for use in the db package.


Constructor Summary
(package private) DatabaseUtil()
           
 
Method Summary
(package private) static void checkForNullDbt(DatabaseEntry dbt, String name, boolean checkData)
          Throw an exception if the dbt is null or the data field is not set.
(package private) static void checkForNullParam(Object param, String name)
          Throw an exception if the parameter is null.
(package private) static void checkForPartialKey(DatabaseEntry dbt)
          Throw an exception if the key dbt has the partial flag set.
(package private) static Locker getReadableLocker(Environment env, Database dbHandle, Locker locker, boolean retainNonTxnLocks)
          Get a locker for this database handle for a read or cursor operation.
(package private) static Locker getReadableLocker(Environment env, Transaction userTxn, boolean dbIsTransactional, boolean retainNonTxnLocks)
          Get a locker for a read or cursor operation.
(package private) static Locker getWritableLocker(Environment env, Transaction userTxn, boolean dbIsTransactional)
          Get a locker for a writable operation, checking whether the db and environment is transactional or not.
(package private) static Locker getWritableLocker(Environment env, Transaction userTxn, boolean dbIsTransactional, boolean retainNonTxnLocks)
          Get a locker for a writable operation, also specifying whether to retain non-transactional locks when a new locker must be created.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseUtil

DatabaseUtil()
Method Detail

getWritableLocker

static Locker getWritableLocker(Environment env,
                                Transaction userTxn,
                                boolean dbIsTransactional)
                         throws DatabaseException
Get a locker for a writable operation, checking whether the db and environment is transactional or not. Must return a non null locker.

Throws:
DatabaseException

getWritableLocker

static Locker getWritableLocker(Environment env,
                                Transaction userTxn,
                                boolean dbIsTransactional,
                                boolean retainNonTxnLocks)
                         throws DatabaseException
Get a locker for a writable operation, also specifying whether to retain non-transactional locks when a new locker must be created. retainNonTxnLocks=true is used for DbTree operations, so that the handle lock may be transferred out of the locker when the operation is complete.

Throws:
DatabaseException

getReadableLocker

static Locker getReadableLocker(Environment env,
                                Transaction userTxn,
                                boolean dbIsTransactional,
                                boolean retainNonTxnLocks)
                         throws DatabaseException
Get a locker for a read or cursor operation. See getWritableLocker for an explanation of retainNonTxnLocks.

Throws:
DatabaseException

getReadableLocker

static Locker getReadableLocker(Environment env,
                                Database dbHandle,
                                Locker locker,
                                boolean retainNonTxnLocks)
                         throws DatabaseException
Get a locker for this database handle for a read or cursor operation. See getWritableLocker for an explanation of retainNonTxnLocks.

Throws:
DatabaseException

checkForNullParam

static void checkForNullParam(Object param,
                              String name)
Throw an exception if the parameter is null.


checkForNullDbt

static void checkForNullDbt(DatabaseEntry dbt,
                            String name,
                            boolean checkData)
Throw an exception if the dbt is null or the data field is not set.


checkForPartialKey

static void checkForPartialKey(DatabaseEntry dbt)
Throw an exception if the key dbt has the partial flag set. This method should be called for all put() operations.



Copyright 2004 Sleepycat, Inc. All Rights Reserved.