|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.LoggerTransactionListener
public class LoggerTransactionListener
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.antelmann.db.TransactionListener |
|---|
TransactionListener.Adapter |
| Constructor Summary | |
|---|---|
LoggerTransactionListener(Logger logger,
Level level)
|
|
| Method Summary | |
|---|---|
void |
finishTransaction(DBTransaction transaction)
called before the transaction commits (and before TransactionListener.prepareToCommit(DBTransaction)),
so that the commit at the database level can be prevented by
throwing a DatabaseException here. |
void |
prepareToCommit(DBTransaction transaction)
called right before the transaction actually commits and after TransactionListener.finishTransaction(DBTransaction). |
void |
transactionAborted(DBTransaction transaction)
called after a database transaction was aborted; the transaction is already inactive. |
void |
transactionBegin(DBTransaction transaction)
called upon beginning a transaction (the transaction is already active) |
void |
transactionCommitted(DBTransaction transaction)
called after a successful database commit; the transaction is already inactive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LoggerTransactionListener(Logger logger,
Level level)
| Method Detail |
|---|
public void finishTransaction(DBTransaction transaction)
throws DatabaseException
TransactionListenerTransactionListener.prepareToCommit(DBTransaction)),
so that the commit at the database level can be prevented by
throwing a DatabaseException here.
This method can also be used to make some updates on another database
or checking on certain data before the transaction is allowed to commit.
In other words, this method may effectively veto the commit of a transaction
After this call, the transaction is soon either going to be committed or aborted
(right after all listeners have been called).
As this method runs within the transaction, it is possible to access/update
any resources from the database.
finishTransaction in interface TransactionListenerDatabaseExceptionpublic void prepareToCommit(DBTransaction transaction)
TransactionListenerTransactionListener.finishTransaction(DBTransaction).
Any exception thrown is ignored; listeners must not do any lengthy operations here.
This may be used for supporting the implementation of a 2-phase-commit.
prepareToCommit in interface TransactionListenertransaction - the transaction (being still active) that is about to be committedpublic void transactionAborted(DBTransaction transaction)
TransactionListenerTransactionException will be thrown.
If you need to access/update resources of this database from this method,
start a new thread that opens a new transaction.
transactionAborted in interface TransactionListenerpublic void transactionBegin(DBTransaction transaction)
TransactionListener
transactionBegin in interface TransactionListenerpublic void transactionCommitted(DBTransaction transaction)
TransactionListenerTransactionException will be thrown.
If you need to access/update resources of this database from this method,
start a new thread that opens a new transaction.
transactionCommitted in interface TransactionListener
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||