Search in sources :

Example 1 with TransactionalContextFactory

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

the class ExecutionEngineTests method createTransactionContext.

private TransactionalContext createTransactionContext(GraphDatabaseQueryService graph, InternalTransaction tx, String query) {
    PropertyContainerLocker locker = new PropertyContainerLocker();
    TransactionalContextFactory contextFactory = Neo4jTransactionalContextFactory.create(graph, locker);
    return contextFactory.newContext(ClientConnectionInfo.EMBEDDED_CONNECTION, tx, query, Collections.emptyMap());
}
Also used : PropertyContainerLocker(org.neo4j.kernel.impl.coreapi.PropertyContainerLocker) Neo4jTransactionalContextFactory(org.neo4j.kernel.impl.query.Neo4jTransactionalContextFactory) TransactionalContextFactory(org.neo4j.kernel.impl.query.TransactionalContextFactory)

Example 2 with TransactionalContextFactory

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

the class Start method createTransactionContext.

private TransactionalContext createTransactionContext(String queryText, Map<String, Object> queryParameters, Session session) {
    DependencyResolver dependencyResolver = getDependencyResolver();
    GraphDatabaseQueryService graph = dependencyResolver.resolveDependency(GraphDatabaseQueryService.class);
    TransactionalContextFactory contextFactory = Neo4jTransactionalContextFactory.create(graph, new PropertyContainerLocker());
    InternalTransaction transaction = graph.beginTransaction(KernelTransaction.Type.implicit, SecurityContext.AUTH_DISABLED);
    return contextFactory.newContext(new ShellConnectionInfo(session.getId()), transaction, queryText, queryParameters);
}
Also used : PropertyContainerLocker(org.neo4j.kernel.impl.coreapi.PropertyContainerLocker) ShellConnectionInfo(org.neo4j.kernel.impl.query.clientconnection.ShellConnectionInfo) GraphDatabaseQueryService(org.neo4j.kernel.GraphDatabaseQueryService) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) TransactionalContextFactory(org.neo4j.kernel.impl.query.TransactionalContextFactory) Neo4jTransactionalContextFactory(org.neo4j.kernel.impl.query.Neo4jTransactionalContextFactory) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Example 3 with TransactionalContextFactory

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

the class TransitionalPeriodTransactionMessContainer method create.

public TransactionalContext create(HttpServletRequest request, GraphDatabaseQueryService service, Type type, SecurityContext securityContext, String query, Map<String, Object> queryParameters) {
    TransactionalContextFactory contextFactory = Neo4jTransactionalContextFactory.create(service, locker);
    ClientConnectionInfo clientConnection = HttpConnectionInfoFactory.create(request);
    InternalTransaction transaction = service.beginTransaction(type, securityContext);
    return contextFactory.newContext(clientConnection, transaction, query, queryParameters);
}
Also used : ClientConnectionInfo(org.neo4j.kernel.impl.query.clientconnection.ClientConnectionInfo) InternalTransaction(org.neo4j.kernel.impl.coreapi.InternalTransaction) Neo4jTransactionalContextFactory(org.neo4j.kernel.impl.query.Neo4jTransactionalContextFactory) TransactionalContextFactory(org.neo4j.kernel.impl.query.TransactionalContextFactory)

Aggregations

Neo4jTransactionalContextFactory (org.neo4j.kernel.impl.query.Neo4jTransactionalContextFactory)3 TransactionalContextFactory (org.neo4j.kernel.impl.query.TransactionalContextFactory)3 InternalTransaction (org.neo4j.kernel.impl.coreapi.InternalTransaction)2 PropertyContainerLocker (org.neo4j.kernel.impl.coreapi.PropertyContainerLocker)2 DependencyResolver (org.neo4j.graphdb.DependencyResolver)1 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)1 ClientConnectionInfo (org.neo4j.kernel.impl.query.clientconnection.ClientConnectionInfo)1 ShellConnectionInfo (org.neo4j.kernel.impl.query.clientconnection.ShellConnectionInfo)1