|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DBTransaction
a transaction controlls access to all resources of a Database through DBClassStore instances. A Thread accessing resources must own the monitor on the active transaction. To ensure thread-save consistency on a transaction, a thread must maintain ownership over the transaction throughout the duration of a transaction.
Database,
TransactionListener| Method Summary | |
|---|---|
void |
abort()
aborts this transaction; requires ownership of this instance. |
boolean |
addTransactionListener(TransactionListener listener)
|
void |
begin()
sets the transaction to active and allows access to the Resources provided that the calling thread holds the lock on this instance. |
void |
commit()
commits all data within the transaction scope to the underlying database; requires ownership of this instance. |
Database<?> |
getDatabase()
gives access to the associated Database |
TransactionListener[] |
getTransactionListeners()
|
boolean |
isActive()
if true, a transaction is currently in progress and has not been committed or aborted, yet. |
boolean |
isReadOnly()
informs whether the currently running transaction is configured to be read-only. |
boolean |
removeTransactionListener(TransactionListener listener)
|
void |
setNextToReadOnly(boolean flag)
allows to configure the next transaction to be read-only. |
| Method Detail |
|---|
boolean addTransactionListener(TransactionListener listener)
boolean removeTransactionListener(TransactionListener listener)
TransactionListener[] getTransactionListeners()
Database<?> getDatabase()
void begin()
throws TransactionException
TransactionException - if the transaction is already active
or if the transaction is in transitionTransactionListener.transactionAborted(DBTransaction),
TransactionListener.transactionCommitted(DBTransaction)
void commit()
throws TransactionException,
DatabaseException
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be committed to the underlying service
void abort()
throws TransactionException,
DatabaseException
TransactionException - if the transaction is already active
DatabaseException - if the transaction could not be aborted from the underlying serviceboolean isActive()
boolean isReadOnly()
setNextToReadOnly(boolean)
void setNextToReadOnly(boolean flag)
throws TransactionException,
UnsupportedOperationException
flag - if true, the next transaction will run read-only;
if false, the next transaction will be read-write
TransactionException - if a transaction is currently active
UnsupportedOperationExceptionisReadOnly()
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||