com.sun.sgs.service.store.db
Interface DbEnvironment

All Known Implementing Classes:
BdbEnvironment, JeEnvironment

public interface DbEnvironment

The interface for interacting with the database implementation. Environments must not be used after the close method is called.


Method Summary
 DbTransaction beginTransaction(long timeout)
          Begins a new transaction with the specified timeout and the implementation-specific default isolation level.
 DbTransaction beginTransaction(long timeout, boolean fullIsolation)
          Begins a transaction with the specified timeout and isolation level.
 void close()
          Closes the environment, releasing any associated resources.
 DbDatabase openDatabase(DbTransaction txn, String fileName, boolean create)
          Opens a database.
 boolean useAllocationBlockPlaceholders()
          Specifies whether object allocations in this environment should use a placeholder at the end of each allocation block to avoid allocation concurrency conflicts.
 

Method Detail

beginTransaction

DbTransaction beginTransaction(long timeout)
Begins a new transaction with the specified timeout and the implementation-specific default isolation level.

Parameters:
timeout - the number of milliseconds the transaction should be allowed to run
Returns:
the transaction
Throws:
IllegalArgumentException - if timeout is less than 1
DbDatabaseException - if an unexpected database problem occurs

beginTransaction

DbTransaction beginTransaction(long timeout,
                               boolean fullIsolation)
Begins a transaction with the specified timeout and isolation level.

Parameters:
timeout - the number of milliseconds the transaction should be allowed to run
fullIsolation - if true, requires the transaction to support full serializable isolation, otherwise uses the default transaction isolation level
Returns:
the transaction
Throws:
IllegalArgumentException - if timeout is less than 1
DbDatabaseException - if an unexpected database problem occurs

openDatabase

DbDatabase openDatabase(DbTransaction txn,
                        String fileName,
                        boolean create)
                        throws FileNotFoundException
Opens a database. Relative database filenames will be interpreted relative to whatever root directory was specified when this environment was created, typically the directory argument passed to DbEnvironmentFactory.getEnvironment.

Parameters:
txn - the transaction under which the database should be opened
fileName - the name of the file containing the database
create - whether to create the database if it does not exist
Returns:
the database
Throws:
IllegalArgumentException - if txn was not created by this environment
FileNotFoundException - if create is false and the database is not found
DbDatabaseException - if an unexpected database problem occurs

close

void close()
Closes the environment, releasing any associated resources. This environment should not be used after this method is called. This method should not be called if any of the transactions or databases associated with this environment are still open.

Throws:
DbDatabaseException - if an unexpected database problem occurs

useAllocationBlockPlaceholders

boolean useAllocationBlockPlaceholders()
Specifies whether object allocations in this environment should use a placeholder at the end of each allocation block to avoid allocation concurrency conflicts.

Returns:
whether object allocations should use an end-of-block placeholder

RedDwarf, Version 0.10.1
2010-03-14 10:56:12

Copyright © 2010 The RedDwarf Authors. All rights reserved
Copyright © 2007-2010 Sun Microsystems, Inc. All rights reserved