Search in sources :

Example 1 with InvalidSemanticsException

use of org.neo4j.exceptions.InvalidSemanticsException in project neo4j by neo4j.

the class Invocation method executeStatement.

private void executeStatement(Statement statement) throws Exception {
    boolean periodicCommit = transactionHandle.isPeriodicCommit(statement.getStatement());
    if (periodicCommit) {
        if (hasPrevious || readStatement() != null) {
            throw new QueryExecutionKernelException(new InvalidSemanticsException("Cannot execute another statement with PERIODIC COMMIT statement in the same transaction", null));
        }
        transactionHandle.closeTransactionForPeriodicCommit();
    }
    hasPrevious = true;
    Result result;
    try {
        result = transactionHandle.executeStatement(statement, periodicCommit);
    } finally {
        if (periodicCommit) {
            transactionHandle.reopenAfterPeriodicCommit();
        }
    }
    writeResult(result, statement);
}
Also used : InvalidSemanticsException(org.neo4j.exceptions.InvalidSemanticsException) QueryExecutionKernelException(org.neo4j.kernel.impl.query.QueryExecutionKernelException) Result(org.neo4j.graphdb.Result)

Aggregations

InvalidSemanticsException (org.neo4j.exceptions.InvalidSemanticsException)1 Result (org.neo4j.graphdb.Result)1 QueryExecutionKernelException (org.neo4j.kernel.impl.query.QueryExecutionKernelException)1