Search in sources :

Example 26 with TransactionalContext

use of org.neo4j.kernel.impl.query.TransactionalContext in project neo4j by neo4j.

the class TransactionImpl method execute.

private Result execute(InternalTransaction transaction, String query, MapValue parameters) throws QueryExecutionException {
    checkInTransaction();
    TransactionalContext context = contextFactory.newContext(transaction, query, parameters);
    try {
        availabilityGuard.assertDatabaseAvailable();
        return executionEngine.executeQuery(query, parameters, context, false);
    } catch (UnavailableException ue) {
        throw new org.neo4j.graphdb.TransactionFailureException(ue.getMessage(), ue);
    } catch (QueryExecutionKernelException e) {
        throw e.asUserException();
    }
}
Also used : QueryExecutionKernelException(org.neo4j.kernel.impl.query.QueryExecutionKernelException) UnavailableException(org.neo4j.kernel.availability.UnavailableException) TransactionalContext(org.neo4j.kernel.impl.query.TransactionalContext)

Aggregations

TransactionalContext (org.neo4j.kernel.impl.query.TransactionalContext)26 Result (org.neo4j.graphdb.Result)17 Test (org.junit.Test)14 HttpServletRequest (javax.servlet.http.HttpServletRequest)10 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)10 InOrder (org.mockito.InOrder)9 Notification (org.neo4j.graphdb.Notification)7 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)7 QueryExecutionKernelException (org.neo4j.kernel.impl.query.QueryExecutionKernelException)6 BoltResult (org.neo4j.bolt.v1.runtime.spi.BoltResult)5 QueryStatistics (org.neo4j.graphdb.QueryStatistics)5 QueryExecution (org.neo4j.kernel.impl.query.QueryExecution)4 Test (org.junit.jupiter.api.Test)3 NullLogProvider (org.neo4j.logging.NullLogProvider)3 Map (java.util.Map)2 Matchers.anyString (org.mockito.Matchers.anyString)2 Config (org.neo4j.configuration.Config)2 CypherException (org.neo4j.cypher.CypherException)2 SyntaxException (org.neo4j.cypher.SyntaxException)2 CompilerFactory (org.neo4j.cypher.internal.CompilerFactory)2