|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DbDatabase
The interface to a database. Databases are associated with a single
database environment, and must be closed before the environment is closed.
Databases must not be used after the close method is called.
| Method Summary | |
|---|---|
void |
close()
Closes this database, releasing any associated resources. |
boolean |
delete(DbTransaction txn,
byte[] key)
Removes the value associated with a key in this database. |
byte[] |
get(DbTransaction txn,
byte[] key,
boolean forUpdate)
Gets the value associated with a key in this database. |
void |
markForUpdate(DbTransaction txn,
byte[] key)
Locks the key and associated value for update. |
DbCursor |
openCursor(DbTransaction txn)
Returns a cursor for iterating over the contents of this database. |
void |
put(DbTransaction txn,
byte[] key,
byte[] value)
Sets the value associated with a key in this database, regardless of whether the key already has an associated value. |
boolean |
putNoOverwrite(DbTransaction txn,
byte[] key,
byte[] value)
Sets the value associated with a key in this database, but only if the key does not already have an associated value. |
| Method Detail |
|---|
byte[] get(DbTransaction txn,
byte[] key,
boolean forUpdate)
null if the key is not found.
txn - the transaction for this operationkey - the keyforUpdate - whether the object should be locked for update
null if the key was not found
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occurs
void markForUpdate(DbTransaction txn,
byte[] key)
txn - the transaction for this operationkey - the key
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occurs
void put(DbTransaction txn,
byte[] key,
byte[] value)
txn - the transaction for this operationkey - the keyvalue - the value
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occurs
boolean putNoOverwrite(DbTransaction txn,
byte[] key,
byte[] value)
txn - the transaction for this operationkey - the keyvalue - the value
true if a value was stored for the key, and false if the key already had a value
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occurs
boolean delete(DbTransaction txn,
byte[] key)
txn - the transaction for this operationkey - the key
true if the value was removed, and false if the
key had no associated value
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occursDbCursor openCursor(DbTransaction txn)
txn - the transaction for this operation
IllegalArgumentException - if txn was not created by the
associated environment
TransactionAbortedException - if the transaction should be
aborted due to timeout or conflict
DbDatabaseException - if an unexpected database problem occursvoid close()
DbDatabaseException - if an unexpected database problem occurs
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||