T
- the type of object communicated from a successful
beforeCommit(TransactionData)
to afterCommit(TransactionData, Object)
.public static class TransactionEventHandler.Adapter<T> extends Object implements TransactionEventHandler<T>
TransactionEventHandler
TransactionEventHandler.Adapter<T>
Constructor and Description |
---|
TransactionEventHandler.Adapter() |
Modifier and Type | Method and Description |
---|---|
void |
afterCommit(TransactionData data,
T state)
Invoked after the transaction has been committed successfully.
|
void |
afterRollback(TransactionData data,
T state)
Invoked after the transaction has been rolled back if committing the
transaction failed for some reason.
|
T |
beforeCommit(TransactionData data)
Invoked when a transaction is about to be committed.
|
public T beforeCommit(TransactionData data) throws Exception
TransactionEventHandler
TransactionFailureException
will be thrown from
Transaction.close()
.
The transaction is still open when this method is invoked, making it
possible to perform mutating operations in this method. This is however
highly discouraged. Changes made in this method are not guaranteed to be
visible by this or other TransactionEventHandler
s.beforeCommit
in interface TransactionEventHandler<T>
data
- the changes that will be committed in this transaction.null
) that will be passed on to
TransactionEventHandler.afterCommit(TransactionData, Object)
or
TransactionEventHandler.afterRollback(TransactionData, Object)
of this object.Exception
- to indicate that the transaction should be rolled back.public void afterCommit(TransactionData data, T state)
TransactionEventHandler
afterCommit
in interface TransactionEventHandler<T>
data
- the changes that were committed in this transaction.state
- the object returned by
TransactionEventHandler.beforeCommit(TransactionData)
.public void afterRollback(TransactionData data, T state)
TransactionEventHandler
afterRollback
in interface TransactionEventHandler<T>
data
- the changes that were committed in this transaction.state
- the object returned by
TransactionEventHandler.beforeCommit(TransactionData)
.Copyright © 2002–2014 The Neo4j Graph Database Project. All rights reserved.