Search in sources :

Example 1 with TransactionApplyKernelException

use of org.neo4j.internal.kernel.api.exceptions.TransactionApplyKernelException in project neo4j by neo4j.

the class RecordStorageEngine method apply.

@Override
public void apply(CommandsToApply batch, TransactionApplicationMode mode) throws Exception {
    TransactionApplierFactoryChain batchApplier = applierChain(mode);
    CommandsToApply initialBatch = batch;
    try (BatchContext context = createBatchContext(batchApplier, batch)) {
        while (batch != null) {
            try (TransactionApplier txApplier = batchApplier.startTx(batch, context)) {
                batch.accept(txApplier);
            }
            batch = batch.next();
        }
    } catch (Throwable cause) {
        TransactionApplyKernelException kernelException = new TransactionApplyKernelException(cause, "Failed to apply transaction: %s", batch == null ? initialBatch : batch);
        databaseHealth.panic(kernelException);
        throw kernelException;
    }
}
Also used : CommandsToApply(org.neo4j.storageengine.api.CommandsToApply) TransactionApplyKernelException(org.neo4j.internal.kernel.api.exceptions.TransactionApplyKernelException)

Aggregations

TransactionApplyKernelException (org.neo4j.internal.kernel.api.exceptions.TransactionApplyKernelException)1 CommandsToApply (org.neo4j.storageengine.api.CommandsToApply)1