Search in sources :

Example 1 with TxStateTransactionDataSnapshot

use of org.neo4j.kernel.impl.coreapi.TxStateTransactionDataSnapshot in project neo4j by neo4j.

the class TransactionEventHandlers method beforeCommit.

@Override
public TransactionHandlerState beforeCommit(ReadableTransactionState state, KernelTransaction transaction, StoreReadLayer storeReadLayer, StorageStatement statement) {
    if (transactionEventHandlers.isEmpty()) {
        return null;
    }
    TransactionData txData = state == null ? EMPTY_DATA : new TxStateTransactionDataSnapshot(state, nodeActions, relationshipActions, storeReadLayer, statement, transaction);
    TransactionHandlerState handlerStates = new TransactionHandlerState(txData);
    for (TransactionEventHandler<?> handler : this.transactionEventHandlers) {
        try {
            handlerStates.add(handler, handler.beforeCommit(txData));
        } catch (Throwable t) {
            handlerStates.failed(t);
        }
    }
    return handlerStates;
}
Also used : TxStateTransactionDataSnapshot(org.neo4j.kernel.impl.coreapi.TxStateTransactionDataSnapshot) TransactionData(org.neo4j.graphdb.event.TransactionData)

Aggregations

TransactionData (org.neo4j.graphdb.event.TransactionData)1 TxStateTransactionDataSnapshot (org.neo4j.kernel.impl.coreapi.TxStateTransactionDataSnapshot)1