Berkeley DB
version 4.5.20

com.sleepycat.db
Class EnvironmentConfig

java.lang.Object
  extended by com.sleepycat.db.EnvironmentConfig
All Implemented Interfaces:
Cloneable

public class EnvironmentConfig
extends Object
implements Cloneable

Specifies the attributes of an environment.

To change the default settings for a database environment, an application creates a configuration object, customizes settings and uses it for environment construction. The set methods of this class validate the configuration values when the method is invoked. An IllegalArgumentException is thrown if the value is not valid for that attribute.

All commonly used environment attributes have convenience setter/getter methods defined in this class. For example, to change the default transaction timeout setting for an environment, the application should do the following:

    // customize an environment configuration
    EnvironmentConfig envConfig = new EnvironmentConfig();
    envConfig.setTxnTimeout(10000);  // will throw if timeout value is invalid
    // Open the environment.
    Environment myEnvironment = new Environment(home, envConfig);

Additional parameters are described in the example.properties file found at the top level of the distribution package. These additional parameters will not be needed by most applications. This category of properties can be specified for the EnvironmentConfig object through a Properties object read by EnvironmentConfig(Properties), or individually through EnvironmentConfig.setConfigParam().

For example, an application can change the default btree node size with:

    envConfig.setConfigParam("je.nodeMaxEntries", "256");

Environment configuration follows this order of precedence:

  1. Configuration parameters specified in <environment home>/je.properties take first precedence.
  2. Configuration parameters set in the EnvironmentConfig object used at Environment construction are next.
  3. Any configuration parameters not set by the application are set to system defaults, described in the example.properties file.

An EnvironmentConfig can be used to specify both mutable and immutable environment properties. Immutable properties may be specified when the first Environment handle (instance) is opened for a given physical environment. When more handles are opened for the same environment, the following rules apply:

  1. Immutable properties must equal the original values specified when constructing an Environment handle for an already open environment. When a mismatch occurs, an exception is thrown.
  2. Mutable properties are ignored when constructing an Environment handle for an already open environment.

After an Environment has been constructed, it's mutable properties may be changed using Environment.setConfig(com.sleepycat.db.EnvironmentConfig).


Field Summary
static EnvironmentConfig DEFAULT
           
 
Constructor Summary
EnvironmentConfig()
          Create an EnvironmentConfig initialized with the system default settings.
 
Method Summary
 void addDataDir(File dataDir)
          Set the path of a directory to be used as the location of the access method database files.
 void addDataDir(String dataDir)
           
 boolean getAllowCreate()
          Return true if the database environment is configured to create any underlying files, as necessary.
 int getCacheCount()
          Return the number of shared memory buffer pools, that is, the number of caches.
 long getCacheSize()
          Return the size of the shared memory buffer pool, that is, the cache.
 boolean getCDBLockAllDatabases()
          Return true if the Concurrent Data Store applications are configured to perform locking on an environment-wide basis rather than on a per-database basis.
 File[] getDataDirs()
          Return the array of data directories.
 boolean getDirectDatabaseIO()
          Return true if the database environment has been configured to not buffer database files.
 boolean getDirectLogIO()
          Return true if the database environment has been configured to not buffer log files.
 boolean getDsyncDatabases()
          Return true if the database environment has been configured to flush database writes to the backing disk before returning from the write system call.
 boolean getDsyncLog()
          Return true if the database environment has been configured to flush log writes to the backing disk before returning from the write system call.
 boolean getEncrypted()
          Return the database environment has been configured to perform encryption.
 ErrorHandler getErrorHandler()
          Return the function to be called if an error occurs.
 String getErrorPrefix()
          Return the prefix string that appears before error messages.
 OutputStream getErrorStream()
          Return the an OutputStream for displaying error messages.
 EventHandler getEventHandler()
          Return the object's methods to be called when a triggered event occurs.
 FeedbackHandler getFeedbackHandler()
          Return the object's methods to be called to provide feedback.
 boolean getInitializeCache()
          Return true if the database environment is configured with a shared memory buffer pool.
 boolean getInitializeCDB()
          Return true if the database environment is configured for the Concurrent Data Store product.
 boolean getInitializeLocking()
          Return true if the database environment is configured for locking.
 boolean getInitializeLogging()
          Return true if the database environment is configured for logging.
 boolean getInitializeRegions()
          Return true if the database environment has been configured to page-fault shared regions into memory when initially creating or joining a database environment.
 boolean getInitializeReplication()
          Return true if the database environment is configured for replication.
 boolean getJoinEnvironment()
          Return the handle is configured to join an existing environment.
 byte[][] getLockConflicts()
          Return the locking conflicts matrix.
 LockDetectMode getLockDetectMode()
          Return true if the deadlock detector is configured to run whenever a lock conflict occurs.
 boolean getLockDown()
          Return true if the database environment is configured to lock shared environment files and memory-mapped databases into memory.
 long getLockTimeout()
          Return the database environment lock timeout value, in microseconds; a timeout of 0 means no timeout is set.
 boolean getLogAutoRemove()
          Return true if the system has been configured to to automatically remove log files that are no longer needed.
 int getLogBufferSize()
          Return the size of the in-memory log buffer, in bytes.
 File getLogDirectory()
          Return the path of a directory to be used as the location of logging files.
 int getLogFileMode()
          Return the absolute file mode for created log files.
 boolean getLogInMemory()
          Return true if the database environment is configured to maintain transaction logs in memory rather than on disk.
 LogRecordHandler getLogRecordHandler()
          Return the handler for application-specific log records.
 int getLogRegionSize()
          Return the size of the underlying logging subsystem region.
 int getMaxLockers()
          Return the maximum number of lockers.
 int getMaxLockObjects()
          Return the maximum number of locked objects.
 int getMaxLocks()
          Return the maximum number of locks.
 int getMaxLogFileSize()
          Return the maximum size of a single file in the log, in bytes.
 int getMaxMutexes()
          Return the total number of mutexes allocated.
 int getMaxOpenFiles()
          Return the maximum number of file descriptors that will be opened concurrently..
 int getMaxWrite()
          Return the maximum number of sequential write operations.
 int getMaxWriteSleep()
          Return the microseconds to pause before scheduling further write operations.
 MessageHandler getMessageHandler()
          Return the function to be called with an informational message.
 OutputStream getMessageStream()
          Return the an OutputStream for displaying informational messages.
 long getMMapSize()
          Return the maximum file size, in bytes, for a file to be mapped into the process address space.
 long getMode()
          Return the mode to use when creating underlying files and shared memory segments.
 boolean getMultiversion()
          Return true if the handle is configured to open all databases for multiversion concurrency control.
 int getMutexAlignment()
          Return the mutex alignment, in bytes.
 int getMutexIncrement()
          Return the number of additional mutexes to allocate.
 int getMutexTestAndSetSpins()
          Return the test-and-set spin count.
 boolean getNoLocking()
          Return true if the system has been configured to grant all requested mutual exclusion mutexes and database locks without regard for their actual availability.
 boolean getNoMMap()
          Return true if the system has been configured to copy read-only database files into the local cache instead of potentially mapping them into process memory.
 boolean getNoPanic()
          Return true if the system has been configured to ignore any panic state in the database environment.
 boolean getOverwrite()
          Return true if the system has been configured to overwrite files stored in encrypted formats before deleting them.
 PanicHandler getPanicHandler()
          Return the function to be called if the database environment panics.
 boolean getPrivate()
          Return true if the database environment is configured to only be accessed by a single process.
 boolean getRegister()
          Return true if the check for process failure when the environment is opened.
 long getReplicationLimit()
          Return the transmit limit in bytes for a single call to Environment.processReplicationMessage.
 ReplicationManagerAckPolicy getReplicationManagerAckPolicy()
          Get the network Ack policy used by the replication manager.
 ReplicationHostAddress getReplicationManagerLocalSite()
          Get the address of the local (this) site in a replication group.
 int getReplicationNumSites()
          Get the total number of sites in the replication group.
 int getReplicationPriority()
          Get the current environments priority.
 int getReplicationRequestMax()
          Get the maximum amount of data sent in response to any request.
 int getReplicationRequestMin()
          Get the minimum amount of data sent in response to any request.
 ReplicationTransport getReplicationTransport()
          Return the replication callback function used to transmit data using the replication application's communication infrastructure.
 boolean getRunFatalRecovery()
          Return the handle is configured to run catastrophic recovery on the database environment before opening it for use.
 boolean getRunRecovery()
          Return the handle is configured to run normal recovery on the database environment before opening it for use.
 long getSegmentId()
          Return the base segment ID.
 boolean getSystemMemory()
          Return true if the database environment is configured to allocate memory from system shared memory instead of from memory backed by the filesystem.
 File getTemporaryDirectory()
          Return the path of a directory to be used as the location of temporary files.
 int getTestAndSetSpins()
          Return the number of times test-and-set mutexes should spin before blocking.
 boolean getThreaded()
          Return true if the handle is configured to be free-threaded.
 boolean getTransactional()
          Return true if the database environment is configured for transactions.
 int getTxnMaxActive()
          Return the minimum number of simultaneously active transactions supported by the database environment.
 boolean getTxnNoSync()
          Return true if the system has been configured to not write or synchronously flush the log on transaction commit.
 boolean getTxnNotDurable()
          Return true if the system has been configured to not write log records.
 boolean getTxnSnapshot()
          Return true if the handle is configured to run all transactions at snapshot isolation.
 long getTxnTimeout()
          Return the database environment transaction timeout value, in microseconds; a timeout of 0 means no timeout is set.
 Date getTxnTimestamp()
          Return the time to which recovery will be done, or 0 if recovery will be done to the most current possible date.
 boolean getTxnWriteNoSync()
          Return true if the system has been configured to write, but not synchronously flush, the log on transaction commit.
 boolean getUseEnvironment()
          Return true if the database environment is configured to accept information from the process environment when naming files.
 boolean getUseEnvironmentRoot()
          Return true if the database environment is configured to accept information from the process environment when naming files if the process has appropriate permissions.
 boolean getVerboseDeadlock()
          Return if the database environment is configured to display additional information when doing deadlock detection.
 boolean getVerboseRecovery()
          Return if the database environment is configured to display additional information when performing recovery.
 boolean getVerboseRegister()
          Return if the database environment is configured to display additional information concerning support for the setRegister(boolean) method.
 boolean getVerboseReplication()
          Return if the database environment is configured to display additional information when processing replication messages.
 boolean getVerboseWaitsFor()
          Return if the database environment is configured to display the waits-for table when doing deadlock detection.
 boolean getYieldCPU()
          Return true if the system has been configured to yield the processor immediately after each page or mutex acquisition.
 void replicationManagerAddRemoteSite(ReplicationHostAddress addr)
          Adds a new replication site to the replication manager's list of known sites.
 void setAllowCreate(boolean allowCreate)
          Configure the database environment to create any underlying files, as necessary.
 void setCacheCount(int cacheCount)
          Set the number of shared memory buffer pools, that is, the number of caches.
 void setCacheSize(long cacheSize)
          Set the size of the shared memory buffer pool, that is, the size of the cache.
 void setCDBLockAllDatabases(boolean cdbLockAllDatabases)
          Configure Concurrent Data Store applications to perform locking on an environment-wide basis rather than on a per-database basis.
 void setDirectDatabaseIO(boolean directDatabaseIO)
          Configure the database environment to not buffer database files.
 void setDirectLogIO(boolean directLogIO)
          Configure the database environment to not buffer log files.
 void setDsyncDatabases(boolean dsyncDatabases)
          Configure the database environment to flush database writes to the backing disk before returning from the write system call, rather than flushing database writes explicitly in a separate system call, as necessary.
 void setDsyncLog(boolean dsyncLog)
          Configure the database environment to flush log writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly in a separate system call.
 void setEncrypted(String password)
          Set the password used to perform encryption and decryption.
 void setErrorHandler(ErrorHandler errorHandler)
          Set the function to be called if an error occurs.
 void setErrorPrefix(String errorPrefix)
          Set the prefix string that appears before error messages.
 void setErrorStream(OutputStream errorStream)
          Set an OutputStream for displaying error messages.
 void setEventHandler(EventHandler handler)
          Set an object whose methods are to be called when a triggered event occurs.
 void setFeedbackHandler(FeedbackHandler feedbackHandler)
          Set an object whose methods are called to provide feedback.
 void setInitializeCache(boolean initializeCache)
          Configure a shared memory buffer pool in the database environment.
 void setInitializeCDB(boolean initializeCDB)
          Configure the database environment for the Concurrent Data Store product.
 void setInitializeLocking(boolean initializeLocking)
          Configure the database environment for locking.
 void setInitializeLogging(boolean initializeLogging)
          Configure the database environment for logging.
 void setInitializeRegions(boolean initializeRegions)
          Configure the database environment to page-fault shared regions into memory when initially creating or joining a database environment.
 void setInitializeReplication(boolean initializeReplication)
          Configure the database environment for replication.
 void setJoinEnvironment(boolean joinEnvironment)
          Configure the handle to join an existing environment.
 void setLockConflicts(byte[][] lockConflicts)
          Configure the locking conflicts matrix.
 void setLockDetectMode(LockDetectMode lockDetectMode)
          Configure if the deadlock detector is to be run whenever a lock conflict occurs.
 void setLockDown(boolean lockDown)
          Configure the database environment to lock shared environment files and memory-mapped databases into memory.
 void setLockTimeout(long lockTimeout)
          Set the timeout value for the database environment locks.
 void setLogAutoRemove(boolean logAutoRemove)
          Configure the system to automatically remove log files that are no longer needed.
 void setLogBufferSize(int logBufferSize)
          Set the size of the in-memory log buffer, in bytes.
 void setLogDirectory(File logDirectory)
          Set the path of a directory to be used as the location of logging files.
 void setLogFileMode(int mode)
          Set the absolute file mode for created log files.
 void setLogInMemory(boolean inmemory)
          If set, maintain transaction logs in memory rather than on disk.
 void setLogRecordHandler(LogRecordHandler logRecordHandler)
          Set a function to process application-specific log records.
 void setLogRegionSize(int logRegionSize)
          Set the size of the underlying logging area of the database environment, in bytes.
 void setMaxLockers(int maxLockers)
          Set the maximum number of locking entities supported by the database environment.
 void setMaxLockObjects(int maxLockObjects)
          Set the maximum number of locked objects supported by the database environment.
 void setMaxLocks(int maxLocks)
          Set the maximum number of locks supported by the database environment.
 void setMaxLogFileSize(int maxLogFileSize)
          Set the maximum size of a single file in the log, in bytes.
 void setMaxMutexes(int maxMutexes)
          Set the total number of mutexes to allocate.
 void setMaxOpenFiles(int maxOpenFiles)
          Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.
 void setMaxWrite(int maxWrite, int maxWriteSleep)
          Limit the number of sequential write operations scheduled by the library when flushing dirty pages from the cache.
 void setMessageHandler(MessageHandler messageHandler)
          Set a function to be called with an informational message.
 void setMessageStream(OutputStream messageStream)
          Set an OutputStream for displaying informational messages.
 void setMMapSize(long mmapSize)
          Set the maximum file size, in bytes, for a file to be mapped into the process address space.
 void setMode(int mode)
          Configure the database environment to use a specific mode when creating underlying files and shared memory segments.
 void setMultiversion(boolean multiversion)
          Configure the database environment to open all databases that are not using the queue access method for multiversion concurrency control.
 void setMutexAlignment(int mutexAlignment)
          Set the mutex alignment, in bytes.
 void setMutexIncrement(int mutexIncrement)
          Increase the number of mutexes to allocate.
 void setMutexTestAndSetSpins(int mutexTestAndSetSpins)
          Specify the number of times that test-and-set mutexes should spin without blocking.
 void setNoLocking(boolean noLocking)
          Configure the system to grant all requested mutual exclusion mutexes and database locks without regard for their actual availability.
 void setNoMMap(boolean noMMap)
          Configure the system to copy read-only database files into the local cache instead of potentially mapping them into process memory.
 void setNoPanic(boolean noPanic)
          Configure the system to ignore any panic state in the database environment.
 void setOverwrite(boolean overwrite)
          Configure the system to overwrite files stored in encrypted formats before deleting them.
 void setPanicHandler(PanicHandler panicHandler)
          Set the function to be called if the database environment panics.
 void setPrivate(boolean isPrivate)
          Configure the database environment to only be accessed by a single process (although that process may be multithreaded).
 void setRegister(boolean register)
          Check if a process has failed while using the database environment, that is, if a process has exited with an open Environment handle.
 void setReplicationLimit(long replicationLimit)
          Impose a byte-count limit on the amount of data that will be transmitted from a site in a single call to Environment.processReplicationMessage.
 void setReplicationManagerAckPolicy(ReplicationManagerAckPolicy policy)
          Set the network Ack policy used by the replication manager.
 void setReplicationManagerLocalSite(ReplicationHostAddress addr)
          Set the address of the local (this) site in a replication group.
 void setReplicationNumSites(int nsites)
          Set the total number of sites in the replication group.
 void setReplicationPriority(int priority)
          Set the current environments priority.
 void setReplicationRequestMax(int max)
          Set the maximum amount of data sent in response to any request.
 void setReplicationRequestMin(int min)
          Set the minimum amount of data sent in response to any request.
 void setReplicationTransport(int envid, ReplicationTransport replicationTransport)
          Initialize the communication infrastructure for a database environment participating in a replicated application.
 void setRPCServer(String rpcServer, long rpcClientTimeout, long rpcServerTimeout)
          Establish a connection to a RPC server for this database environment.
 void setRunFatalRecovery(boolean runFatalRecovery)
          Configure to run catastrophic recovery on this environment before opening it for normal use.
 void setRunRecovery(boolean runRecovery)
          Configure to run normal recovery on this environment before opening it for normal use.
 void setSegmentId(long segmentId)
          Specify a base segment ID for database environment shared memory regions created in system memory on VxWorks or systems supporting X/Open-style shared memory interfaces; for example, UNIX systems supporting shmget and related System V IPC interfaces.
 void setSystemMemory(boolean systemMemory)
          Configure the database environment to allocate memory from system shared memory instead of from memory backed by the filesystem.
 void setTemporaryDirectory(File temporaryDirectory)
          Set the path of a directory to be used as the location of temporary files.
 void setTemporaryDirectory(String dataDir)
           
 void setTestAndSetSpins(int testAndSetSpins)
          Set the number of times test-and-set mutexes should spin before blocking.
 void setThreaded(boolean threaded)
          Configure the handle to be free-threaded; that is, usable by multiple threads within a single address space.
 void setTransactional(boolean transactional)
          Configure the database environment for transactions.
 void setTxnMaxActive(int txnMaxActive)
          Configure the database environment to support at least txnMaxActive active transactions.
 void setTxnNoSync(boolean txnNoSync)
          Configure the system to not write or synchronously flush the log on transaction commit.
 void setTxnNotDurable(boolean txnNotDurable)
          Configure the system to not write log records.
 void setTxnSnapshot(boolean txnSnapshot)
          Configure the database environment to run transactions at snapshot isolation by default.
 void setTxnTimeout(long txnTimeout)
          Set the timeout value for the database environment transactions.
 void setTxnTimestamp(Date txnTimestamp)
          Recover to the specified time rather than to the most current possible date.
 void setTxnWriteNoSync(boolean txnWriteNoSync)
          Configure the system to write, but not synchronously flush, the log on transaction commit.
 void setUseEnvironment(boolean useEnvironment)
          Configure the database environment to accept information from the process environment when naming files, regardless of the status of the process.
 void setUseEnvironmentRoot(boolean useEnvironmentRoot)
          Configure the database environment to accept information from the process environment when naming files, if the process has appropriate permissions (for example, users with a user-ID of 0 on UNIX systems).
 void setVerboseDeadlock(boolean verboseDeadlock)
          Display additional information when doing deadlock detection.
 void setVerboseRecovery(boolean verboseRecovery)
          Display additional information when performing recovery.
 void setVerboseRegister(boolean verboseRegister)
          Display additional information concerning support for the setRegister(boolean) method.
 void setVerboseReplication(boolean verboseReplication)
          Display additional information when processing replication messages.
 void setVerboseWaitsFor(boolean verboseWaitsFor)
          Display the waits-for table when doing deadlock detection.
 void setYieldCPU(boolean yieldCPU)
          Configure the system to yield the processor immediately after each page or mutex acquisition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final EnvironmentConfig DEFAULT
Constructor Detail

EnvironmentConfig

public EnvironmentConfig()
Create an EnvironmentConfig initialized with the system default settings.

Method Detail

setTransactional

public void setTransactional(boolean transactional)
Configure the database environment for transactions.

This configuration option should be used when transactional guarantees such as atomicity of multiple operations and durability are important.

Parameters:
transactional - If true, configure the database environment for transactions.

getTransactional

public boolean getTransactional()
Return true if the database environment is configured for transactions.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for transactions.

setAllowCreate

public void setAllowCreate(boolean allowCreate)
Configure the database environment to create any underlying files, as necessary.

Parameters:
allowCreate - If true, configure the database environment to create any underlying files, as necessary.

getAllowCreate

public boolean getAllowCreate()
Return true if the database environment is configured to create any underlying files, as necessary.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured to create any underlying files, as necessary.

setCacheSize

public void setCacheSize(long cacheSize)
Set the size of the shared memory buffer pool, that is, the size of the cache.

The cache should be the size of the normal working data set of the application, with some small amount of additional memory for unusual situations. (Note: the working set is not the same as the number of pages accessed simultaneously, and is usually much larger.)

The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are used as specified. The current maximum size of a single cache is 4GB. (All sizes are in powers-of-two, that is, 256KB is 2^18 not 256,000.)

The database environment's cache size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_cachesize", one or more whitespace characters, and the cache size specified in three parts: the gigabytes of cache, the additional bytes of cache, and the number of caches, also separated by whitespace characters. For example, "set_cachesize 2 524288000 3" would create a 2.5GB logical cache, split between three physical caches. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

This method may be called at any time during the life of the application.

Parameters:
cacheSize - The size of the shared memory buffer pool, that is, the size of the cache.

Throws:
DatabaseException - if a failure occurs.

getCacheSize

public long getCacheSize()
Return the size of the shared memory buffer pool, that is, the cache.

This method may be called at any time during the life of the application.

Returns:
The size of the shared memory buffer pool, that is, the cache.

setCacheCount

public void setCacheCount(int cacheCount)
Set the number of shared memory buffer pools, that is, the number of caches.

It is possible to specify caches larger than 4GB and/or large enough they cannot be allocated contiguously on some architectures. For example, some releases of Solaris limit the amount of memory that may be allocated contiguously by a process. This method allows applications to break the cache broken up into a number of equally sized, separate pieces of memory.

The database environment's cache size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_cachesize", one or more whitespace characters, and the cache size specified in three parts: the gigabytes of cache, the additional bytes of cache, and the number of caches, also separated by whitespace characters. For example, "set_cachesize 2 524288000 3" would create a 2.5GB logical cache, split between three physical caches. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

This method may be called at any time during the life of the application.

Parameters:
cacheCount - The number of shared memory buffer pools, that is, the number of caches.

Throws:
DatabaseException - if a failure occurs.

getCacheCount

public int getCacheCount()
Return the number of shared memory buffer pools, that is, the number of caches.

This method may be called at any time during the life of the application.

Returns:
The number of shared memory buffer pools, that is, the number of caches.

setCDBLockAllDatabases

public void setCDBLockAllDatabases(boolean cdbLockAllDatabases)
Configure Concurrent Data Store applications to perform locking on an environment-wide basis rather than on a per-database basis.

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may not be called after the environment has been opened.

Parameters:
cdbLockAllDatabases - If true, configure Concurrent Data Store applications to perform locking on an environment-wide basis rather than on a per-database basis.

getCDBLockAllDatabases

public boolean getCDBLockAllDatabases()
Return true if the Concurrent Data Store applications are configured to perform locking on an environment-wide basis rather than on a per-database basis.

This method may be called at any time during the life of the application.

Returns:
True if the Concurrent Data Store applications are configured to perform locking on an environment-wide basis rather than on a per-database basis.

addDataDir

public void addDataDir(File dataDir)
Set the path of a directory to be used as the location of the access method database files.

Paths specified to Environment.openDatabase and Environment.openSecondaryDatabase will be searched relative to this path. Paths set using this method are additive, and specifying more than one will result in each specified directory being searched for database files. If any directories are specified, created database files will always be created in the first path specified.

If no database directories are specified, database files must be named either by absolute paths or relative to the environment home directory.

The database environment's data directories may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_data_dir", one or more whitespace characters, and the directory name.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
dataDir - A directory to be used as a location for database files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

addDataDir

public void addDataDir(String dataDir)

getDataDirs

public File[] getDataDirs()
Return the array of data directories.

This method may be called at any time during the life of the application.

Returns:
The array of data directories.

setDirectDatabaseIO

public void setDirectDatabaseIO(boolean directDatabaseIO)
Configure the database environment to not buffer database files.

This is intended to avoid to avoid double caching.

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may be called at any time during the life of the application.

Parameters:
directDatabaseIO - If true, configure the database environment to not buffer database files.

getDirectDatabaseIO

public boolean getDirectDatabaseIO()
Return true if the database environment has been configured to not buffer database files.

This method may be called at any time during the life of the application.

Returns:
True if the database environment has been configured to not buffer database files.

setDirectLogIO

public void setDirectLogIO(boolean directLogIO)
Configure the database environment to not buffer log files.

This is intended to avoid to avoid double caching.

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may be called at any time during the life of the application.

Parameters:
directLogIO - If true, configure the database environment to not buffer log files.

getDirectLogIO

public boolean getDirectLogIO()
Return true if the database environment has been configured to not buffer log files.

This method may be called at any time during the life of the application.

Returns:
True if the database environment has been configured to not buffer log files.

setDsyncDatabases

public void setDsyncDatabases(boolean dsyncDatabases)
Configure the database environment to flush database writes to the backing disk before returning from the write system call, rather than flushing database writes explicitly in a separate system call, as necessary.

This is only available on some systems (for example, systems supporting the m4_posix1_name standard O_DSYNC flag, or systems supporting the Win32 FILE_FLAG_WRITE_THROUGH flag). This flag may result in inaccurate file modification times and other file-level information for Berkeley DB database files. This flag will almost certainly result in a performance decrease on most systems. This flag is only applicable to certain filesysystem (for example, the Veritas VxFS filesystem), where the filesystem's support for trickling writes back to stable storage behaves badly (or more likely, has been misconfigured).

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may be called at any time during the life of the application.

Parameters:
dsyncDatabases - If true, configure the database environment to flush database writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly in a separate system call.

getDsyncDatabases

public boolean getDsyncDatabases()
Return true if the database environment has been configured to flush database writes to the backing disk before returning from the write system call.

This method may be called at any time during the life of the application.

Returns:
True if the database environment has been configured to flush database writes to the backing disk before returning from the write system call.

setDsyncLog

public void setDsyncLog(boolean dsyncLog)
Configure the database environment to flush log writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly in a separate system call.

This configuration is only available on some systems (for example, systems supporting the POSIX standard O_DSYNC flag, or systems supporting the Win32 FILE_FLAG_WRITE_THROUGH flag). This configuration may result in inaccurate file modification times and other file-level information for Berkeley DB log files. This configuration may offer a performance increase on some systems and a performance decrease on others.

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may be called at any time during the life of the application.

Parameters:
dsyncLog - If true, configure the database environment to flush log writes to the backing disk before returning from the write system call, rather than flushing log writes explicitly in a separate system call.

getDsyncLog

public boolean getDsyncLog()
Return true if the database environment has been configured to flush log writes to the backing disk before returning from the write system call.

This method may be called at any time during the life of the application.

Returns:
True if the database environment has been configured to flush log writes to the backing disk before returning from the write system call.

setEncrypted

public void setEncrypted(String password)
Set the password used to perform encryption and decryption.

Berkeley DB uses the Rijndael/AES (also known as the Advanced Encryption Standard and Federal Information Processing Standard (FIPS) 197) algorithm for encryption or decryption.


getEncrypted

public boolean getEncrypted()
Return the database environment has been configured to perform encryption.

This method may be called at any time during the life of the application.

Returns:
The database environment has been configured to perform encryption.

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Set the function to be called if an error occurs.

When an error occurs in the Berkeley DB library, an exception is thrown. In some cases, however, the error information returned to the application may be insufficient to completely describe the cause of the error, especially during initial application debugging.

The EnvironmentConfig.setErrorHandler and DatabaseConfig.setErrorHandler methods are used to enhance the mechanism for reporting error messages to the application. In some cases, when an error occurs, Berkeley DB will invoke the ErrorHandler's object error method. It is up to this method to display the error message in an appropriate manner.

Alternatively, applications can use EnvironmentConfig.setErrorStream and DatabaseConfig.setErrorStream to display the additional information via an output stream. Applications should not mix these approaches.

This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

This method may be called at any time during the life of the application.

Parameters:
errorHandler - The function to be called if an error occurs.

getErrorHandler

public ErrorHandler getErrorHandler()
Return the function to be called if an error occurs.

This method may be called at any time during the life of the application.

Returns:
The function to be called if an error occurs.

setErrorPrefix

public void setErrorPrefix(String errorPrefix)
Set the prefix string that appears before error messages.

This method may be called at any time during the life of the application.

Parameters:
errorPrefix - The prefix string that appears before error messages.

getErrorPrefix

public String getErrorPrefix()
Return the prefix string that appears before error messages.

This method may be called at any time during the life of the application.

Returns:
The prefix string that appears before error messages.

setErrorStream

public void setErrorStream(OutputStream errorStream)
Set an OutputStream for displaying error messages.

When an error occurs in the Berkeley DB library, an exception is thrown. In some cases, however, the error information returned to the application may be insufficient to completely describe the cause of the error, especially during initial application debugging.

The EnvironmentConfig.setErrorStream and DatabaseConfig.setErrorStream methods are used to enhance the mechanism for reporting error messages to the application by setting a OutputStream to be used for displaying additional Berkeley DB error messages. In some cases, when an error occurs, Berkeley DB will output an additional error message to the specified stream.

The error message will consist of the prefix string and a colon (":") (if a prefix string was previously specified using EnvironmentConfig.setErrorPrefix or DatabaseConfig.setErrorPrefix), an error string, and a trailing newline character.

Setting errorStream to null unconfigures the interface.

Alternatively, applications can use EnvironmentConfig.setErrorHandler and DatabaseConfig.setErrorHandler to capture the additional error information in a way that does not use output streams. Applications should not mix these approaches.

This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.

This method may be called at any time during the life of the application.

Parameters:
errorStream - The application-specified OutputStream for error messages.

getErrorStream

public OutputStream getErrorStream()
Return the an OutputStream for displaying error messages.

This method may be called at any time during the life of the application.

Returns:
The an OutputStream for displaying error messages.

getEventHandler

public EventHandler getEventHandler()
Return the object's methods to be called when a triggered event occurs.

This method may be called at any time during the life of the application.

Returns:
The object's methods to be called when a triggered event occurs.

setEventHandler

public void setEventHandler(EventHandler handler)
Set an object whose methods are to be called when a triggered event occurs.

Parameters:
handler - An object whose methods are called when event callbacks are initiated from within Berkeley DB.

setFeedbackHandler

public void setFeedbackHandler(FeedbackHandler feedbackHandler)
Set an object whose methods are called to provide feedback.

Some operations performed by the Berkeley DB library can take non-trivial amounts of time. This method can be used by applications to monitor progress within these operations. When an operation is likely to take a long time, Berkeley DB will call the object's methods with progress information.

It is up to the object's methods to display this information in an appropriate manner.

This method configures only operations performed using a single a Environment handle

This method may be called at any time during the life of the application.

Parameters:
feedbackHandler - An object whose methods are called to provide feedback.

getFeedbackHandler

public FeedbackHandler getFeedbackHandler()
Return the object's methods to be called to provide feedback.

This method may be called at any time during the life of the application.

Returns:
The object's methods to be called to provide feedback.

setInitializeCache

public void setInitializeCache(boolean initializeCache)
Configure a shared memory buffer pool in the database environment.

This subsystem should be used whenever an application is using any Berkeley DB access method.

Parameters:
initializeCache - If true, configure a shared memory buffer pool in the database environment.

getInitializeCache

public boolean getInitializeCache()
Return true if the database environment is configured with a shared memory buffer pool.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured with a shared memory buffer pool.

setInitializeCDB

public void setInitializeCDB(boolean initializeCDB)
Configure the database environment for the Concurrent Data Store product.

In this mode, Berkeley DB provides multiple reader/single writer access. The only other subsystem that should be specified for this handle is a cache.

Parameters:
initializeCDB - If true, configure the database environment for the Concurrent Data Store product.

getInitializeCDB

public boolean getInitializeCDB()
Return true if the database environment is configured for the Concurrent Data Store product.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for the Concurrent Data Store product.

setInitializeLocking

public void setInitializeLocking(boolean initializeLocking)
Configure the database environment for locking.

Locking should be used when multiple processes or threads are going to be reading and writing a database, so they do not interfere with each other. If all threads are accessing the database(s) read-only, locking is unnecessary. When locking is configured, it is usually necessary to run a deadlock detector, as well.

Parameters:
initializeLocking - If true, configure the database environment for locking.

getInitializeLocking

public boolean getInitializeLocking()
Return true if the database environment is configured for locking.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for locking.

setInitializeLogging

public void setInitializeLogging(boolean initializeLogging)
Configure the database environment for logging.

Logging should be used when recovery from application or system failure is necessary. If the log region is being created and log files are already present, the log files are reviewed; subsequent log writes are appended to the end of the log, rather than overwriting current log entries.

Parameters:
initializeLogging - If true, configure the database environment for logging.

getInitializeLogging

public boolean getInitializeLogging()
Return true if the database environment is configured for logging.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for logging.

setInitializeRegions

public void setInitializeRegions(boolean initializeRegions)
Configure the database environment to page-fault shared regions into memory when initially creating or joining a database environment.

In some applications, the expense of page-faulting the underlying shared memory regions can affect performance. For example, if the page-fault occurs while holding a lock, other lock requests can convoy, and overall throughput may decrease. This method configures Berkeley DB to page-fault shared regions into memory when initially creating or joining a database environment. In addition, Berkeley DB will write the shared regions when creating an environment, forcing the underlying virtual memory and filesystems to instantiate both the necessary memory and the necessary disk space. This can also avoid out-of-disk space failures later on.

This method only affects the specified Environment handle (and any other library handles opened within the scope of that handle). For consistent behavior across the environment, all Environment handles opened in the database environment must either call this method or the configuration should be specified in the database environment's DB_CONFIG configuration file.

This method may be called at any time during the life of the application.

Parameters:
initializeRegions - If true, configure the database environment to page-fault shared regions into memory when initially creating or joining a database environment.

getInitializeRegions

public boolean getInitializeRegions()
Return true if the database environment has been configured to page-fault shared regions into memory when initially creating or joining a database environment.

This method may be called at any time during the life of the application.

Returns:
True if the database environment has been configured to page-fault shared regions into memory when initially creating or joining a database environment.

setInitializeReplication

public void setInitializeReplication(boolean initializeReplication)
Configure the database environment for replication.

Replication requires both locking and transactions.

Parameters:
initializeReplication - If true, configure the database environment for replication.

getInitializeReplication

public boolean getInitializeReplication()
Return true if the database environment is configured for replication.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured for replication.

setJoinEnvironment

public void setJoinEnvironment(boolean joinEnvironment)
Configure the handle to join an existing environment.

This option allows applications to join an existing environment without knowing which subsystems the environment supports.

Parameters:
joinEnvironment - If true, configure the handle to join an existing environment.

getJoinEnvironment

public boolean getJoinEnvironment()
Return the handle is configured to join an existing environment.

This method may be called at any time during the life of the application.

Returns:
The handle is configured to join an existing environment.

setLockConflicts

public void setLockConflicts(byte[][] lockConflicts)
Configure the locking conflicts matrix.

If the locking conflicts matrix is never configured, a standard conflicts array is used.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
lockConflicts - The locking conflicts matrix. A non-0 value for an array element indicates the requested_mode and held_mode conflict:
        lockConflicts[requested_mode][held_mode]
    

The not-granted mode must be represented by 0.


getLockConflicts

public byte[][] getLockConflicts()
Return the locking conflicts matrix.

This method may be called at any time during the life of the application.

Returns:
The locking conflicts matrix.

setLockDetectMode

public void setLockDetectMode(LockDetectMode lockDetectMode)
Configure if the deadlock detector is to be run whenever a lock conflict occurs.

The database environment's deadlock detector configuration may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_detect", one or more whitespace characters, and the method detect parameter as a string; for example, "set_lk_detect DB_LOCK_OLDEST". Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

Although the method may be called at any time during the life of the application, it should normally be called before opening the database environment.

Parameters:
lockDetectMode - The lock request(s) to be rejected. As transactions acquire locks on behalf of a single locker ID, rejecting a lock request associated with a transaction normally requires the transaction be aborted.

getLockDetectMode

public LockDetectMode getLockDetectMode()
Return true if the deadlock detector is configured to run whenever a lock conflict occurs.

This method may be called at any time during the life of the application.

Returns:
True if the deadlock detector is configured to run whenever a lock conflict occurs.

setLockDown

public void setLockDown(boolean lockDown)
Configure the database environment to lock shared environment files and memory-mapped databases into memory.

Parameters:
lockDown - If true, configure the database environment to lock shared environment files and memory-mapped databases into memory.

getLockDown

public boolean getLockDown()
Return true if the database environment is configured to lock shared environment files and memory-mapped databases into memory.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured to lock shared environment files and memory-mapped databases into memory.

setLockTimeout

public void setLockTimeout(long lockTimeout)
Set the timeout value for the database environment locks.

Lock timeouts are checked whenever a thread of control blocks on a lock or when deadlock detection is performed. The lock may have been requested explicitly through the Lock subsystem interfaces, or it may be a lock requested by the database access methods underlying the application. As timeouts are only checked when the lock request first blocks or when deadlock detection is performed, the accuracy of the timeout depends on how often deadlock detection is performed.

Timeout values specified for the database environment may be overridden on a per-lock basis by Environment.lockVector.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
lockTimeout - The timeout value, specified as an unsigned 32-bit number of microseconds, limiting the maximum timeout to roughly 71 minutes.

Throws:
IllegalArgumentException - if an invalid parameter was specified.

DatabaseException - if a failure occurs.

getLockTimeout

public long getLockTimeout()
Return the database environment lock timeout value, in microseconds; a timeout of 0 means no timeout is set.

This method may be called at any time during the life of the application.

Returns:
The database environment lock timeout value, in microseconds; a timeout of 0 means no timeout is set.

setLogAutoRemove

public void setLogAutoRemove(boolean logAutoRemove)
Configure the system to automatically remove log files that are no longer needed.

Automatic log file removal is likely to make catastrophic recovery impossible.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
logAutoRemove - If true, configure the system to automatically remove log files that are no longer needed.

getLogAutoRemove

public boolean getLogAutoRemove()
Return true if the system has been configured to to automatically remove log files that are no longer needed.

This method may be called at any time during the life of the application.

Returns:
True if the system has been configured to to automatically remove log files that are no longer needed.

setLogInMemory

public void setLogInMemory(boolean inmemory)
If set, maintain transaction logs in memory rather than on disk. This means that transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but if the application or system fails, integrity will not persist. All database files must be verified and/or restored from a replication group master or archival backup after application or system failure.

When in-memory logs are configured and no more log buffer space is available, Berkeley DB methods will throw a DatabaseException. When choosing log buffer and file sizes for in-memory logs, applications should ensure the in-memory log buffer size is large enough that no transaction will ever span the entire buffer, and avoid a state where the in-memory buffer is full and no space can be freed because a transaction that started in the first log "file" is still active.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
inmemory - If true, maintain transaction logs in memory rather than on disk.

getLogInMemory

public boolean getLogInMemory()
Return true if the database environment is configured to maintain transaction logs in memory rather than on disk.

This method may be called at any time during the life of the application.

Returns:
True if the database environment is configured to maintain transaction logs in memory rather than on disk.

setLogRecordHandler

public void setLogRecordHandler(LogRecordHandler logRecordHandler)
Set a function to process application-specific log records.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logRecordHandler - The handler for application-specific log records.

getLogRecordHandler

public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockObjects - The maximum number of locked objects supported by the database environment.

getMaxLockObjects

public int getMaxLockObjects()
Return the maximum number of locked objects.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locked objects.

setMaxLogFileSize

public void setMaxLogFileSize(int maxLogFileSize)
Set the maximum size of a single file in the log, in bytes.

By default, or if the maxLogFileSize parameter is set to 0, a size of 10MB is used. If no size is specified by the application, the size last specified for the database region will be used, or if no database region previously existed, the default will be used. Because LogSequenceNumber file offsets are unsigned four-byte values, the set value may not be larger than the maximum unsigned four-byte value.

The database environment's log file size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_max", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may be called at any time during the life of the application.

Parameters:
maxLogFileSize - The maximum size of a single file in the log, in bytes.

getMaxLogFileSize

public int getMaxLogFileSize()
Return the maximum size of a single file in the log, in bytes.

This method may be called at any time during the life of the application.

Returns:
The maximum size of a single file in the log, in bytes.

setLogBufferSize

public void setLogBufferSize(int logBufferSize)
Set the size of the in-memory log buffer, in bytes.

Log information is stored in-memory until the storage space fills up or transaction commit forces the information to be flushed to stable storage. In the presence of long-running transactions or transactions producing large amounts of data, larger buffer sizes can increase throughput.

By default, or if the value is set to 0, a size of 32K is used.

The database environment's log buffer size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_bsize", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logBufferSize - The size of the in-memory log buffer, in bytes.

getLogBufferSize

public int getLogBufferSize()
Return the size of the in-memory log buffer, in bytes.

This method may be called at any time during the life of the application.

Returns:
The size of the in-memory log buffer, in bytes.

setLogDirectory

public void setLogDirectory(File logDirectory)
Set the path of a directory to be used as the location of logging files.

Log files created by the Log Manager subsystem will be created in this directory. If no logging directory is specified, log files are created in the environment home directory.

For the greatest degree of recoverability from system or application failure, database files and log files should be located on separate physical devices.

The database environment's logging directory may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_dir", one or more whitespace characters, and the directory name. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures only operations performed using a single a Environment handle, not an entire database environment.

This method may not be called after the environment has been opened. If joining an existing database environment, the information specified to this method must be consistent with the existing environment or corruption can occur.

Parameters:
logDirectory - The directory used to store the logging files. On Windows platforms, this argument will be interpreted as a UTF-8 string, which is equivalent to ASCII for Latin characters.

getLogDirectory

public File getLogDirectory()
Return the path of a directory to be used as the location of logging files.

This method may be called at any time during the life of the application.

Returns:
The path of a directory to be used as the location of logging files.

getLogFileMode

public int getLogFileMode()
Return the absolute file mode for created log files.

This method may be called at any time during the life of the application.

Returns:
The absolute file mode for created log files.

setLogFileMode

public void setLogFileMode(int mode)
Set the absolute file mode for created log files. This method is only useful for the rare Berkeley DB application that does not control its umask value.

Normally, if Berkeley DB applications set their umask appropriately, all processes in the application suite will have read permission on the log files created by any process in the application suite. However, if the Berkeley DB application is a library, a process using the library might set its umask to a value preventing other processes in the application suite from reading the log files it creates. In this rare case, this method can be used to set the mode of created log files to an absolute value.

Parameters:
mode - The absolute mode of the created log file.

setLogRegionSize

public void setLogRegionSize(int logRegionSize)
Set the size of the underlying logging area of the database environment, in bytes.

By default, or if the value is set to 0, the default size is 60KB. The log region is used to store filenames, and so may need to be increased in size if a large number of files will be opened and registered with the specified database environment's log manager.

The database environment's log region size may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lg_regionmax", one or more whitespace characters, and the size in bytes. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
logRegionSize - The size of the logging area in the database environment, in bytes.

getLogRegionSize

public int getLogRegionSize()
Return the size of the underlying logging subsystem region.

This method may be called at any time during the life of the application.

Returns:
The size of the underlying logging subsystem region.

setMaxOpenFiles

public void setMaxOpenFiles(int maxOpenFiles)
Limit the number of file descriptors the library will open concurrently when flushing dirty pages from the cache.

Parameters:
maxOpenFiles - The maximum number of n>
public LogRecordHandler getLogRecordHandler()
Return the handler for application-specific log records.

This method may be called at any time during the life of the application.

Returns:
The handler for application-specific log records.

setMaxLocks

public void setMaxLocks(int maxLocks)
Set the maximum number of locks supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 locks.

The database environment's maximum number of locks may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_locks", one or more whitespace characters, and the number of locks. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLocks - The maximum number of locks supported by the database environment.

getMaxLocks

public int getMaxLocks()
Return the maximum number of locks.

This method may be called at any time during the life of the application.

Returns:
The maximum number of locks.

setMaxLockers

public void setMaxLockers(int maxLockers)
Set the maximum number of locking entities supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 lockers.

The database environment's maximum number of lockers may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_lockers", one or more whitespace characters, and the number of lockers. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method configures a database environment, including all threads of control accessing the database environment, not only the operations performed using a specified Environment handle.

This method may not be called after the environment has been opened. If joining an existing database environment, any information specified to this method will be ignored.

Parameters:
maxLockers - The maximum number simultaneous locking entities supported by the database environment.

getMaxLockers

public int getMaxLockers()
Return the maximum number of lockers.

This method may be called at any time during the life of the application.

Returns:
The maximum number of lockers.

setMaxLockObjects

public void setMaxLockObjects(int maxLockObjects)
Set the maximum number of locked objects supported by the database environment.

This value is used during environment creation to estimate how much space to allocate for various lock-table data structures. The default value is 1000 objects.

The database environment's maximum number of objects may also be set using the environment's DB_CONFIG file. The syntax of the entry in that file is a single line with the string "set_lk_max_objects", one or more whitespace characters, and the number of objects. Because the DB_CONFIG file is read when the database environment is opened, it will silently overrule configuration done before that time.

This method c