use of org.neo4j.bolt.dbapi.BoltQueryExecution in project neo4j by neo4j.
the class TestFabricTransaction method execute.
@Override
public Result execute(String query, Map<String, Object> parameters) throws QueryExecutionException {
var ctx = new TestFabricTransactionalContext(kernelInternalTransaction);
var params = ValueUtils.asParameterMapValue(parameters);
var result = new ResultSubscriber(ctx, ctx.valueMapper());
try {
BoltQueryExecution boltQueryExecution = fabricTransaction.executeQuery(query, params, false, result);
result.init(boltQueryExecution.getQueryExecution());
} catch (FabricException e) {
if (e.getCause() instanceof RuntimeException) {
throw (RuntimeException) e.getCause();
} else {
throw new QueryExecutionException(e.getMessage(), e, e.status().code().serialize());
}
} catch (QueryExecutionKernelException | Neo4jException e) {
throw new QueryExecutionException(e.getMessage(), e, e.status().code().serialize());
}
return result;
}
use of org.neo4j.bolt.dbapi.BoltQueryExecution in project neo4j by neo4j.
the class BoltQueryExecutorImpl method executeQuery.
@Override
public BoltQueryExecution executeQuery(String query, MapValue parameters, boolean prePopulate, QuerySubscriber subscriber) throws QueryExecutionKernelException {
TransactionalContext transactionalContext = transactionalContextFactory.newContext(internalTransaction, query, parameters);
QueryExecution queryExecution = queryExecutionEngine.executeQuery(query, parameters, transactionalContext, prePopulate, subscriber);
return new BoltQueryExecutionImpl(queryExecution, transactionalContext);
}
Aggregations