Search in sources :

Example 1 with TransitionalPeriodTransactionMessContainer

use of org.neo4j.server.rest.transactional.TransitionalPeriodTransactionMessContainer in project neo4j by neo4j.

the class AbstractNeoServer method createTransactionalActions.

private TransactionFacade createTransactionalActions() {
    final long timeoutMillis = getTransactionTimeoutMillis();
    final Clock clock = Clocks.systemClock();
    transactionRegistry = new TransactionHandleRegistry(clock, timeoutMillis, logProvider);
    // ensure that this is > 0
    long runEvery = round(timeoutMillis / 2.0);
    resolveDependency(JobScheduler.class).scheduleRecurring(serverTransactionTimeout, () -> {
        long maxAge = clock.millis() - timeoutMillis;
        transactionRegistry.rollbackSuspendedTransactionsIdleSince(maxAge);
    }, runEvery, MILLISECONDS);
    DependencyResolver dependencyResolver = database.getGraph().getDependencyResolver();
    return new TransactionFacade(new TransitionalPeriodTransactionMessContainer(database.getGraph()), dependencyResolver.resolveDependency(QueryExecutionEngine.class), dependencyResolver.resolveDependency(GraphDatabaseQueryService.class), transactionRegistry, logProvider);
}
Also used : JobScheduler(org.neo4j.kernel.impl.util.JobScheduler) TransitionalPeriodTransactionMessContainer(org.neo4j.server.rest.transactional.TransitionalPeriodTransactionMessContainer) QueryExecutionEngine(org.neo4j.kernel.impl.query.QueryExecutionEngine) GraphDatabaseQueryService(org.neo4j.kernel.GraphDatabaseQueryService) TransactionFacade(org.neo4j.server.rest.transactional.TransactionFacade) TransactionHandleRegistry(org.neo4j.server.rest.transactional.TransactionHandleRegistry) Clock(java.time.Clock) DependencyResolver(org.neo4j.graphdb.DependencyResolver)

Aggregations

Clock (java.time.Clock)1 DependencyResolver (org.neo4j.graphdb.DependencyResolver)1 GraphDatabaseQueryService (org.neo4j.kernel.GraphDatabaseQueryService)1 QueryExecutionEngine (org.neo4j.kernel.impl.query.QueryExecutionEngine)1 JobScheduler (org.neo4j.kernel.impl.util.JobScheduler)1 TransactionFacade (org.neo4j.server.rest.transactional.TransactionFacade)1 TransactionHandleRegistry (org.neo4j.server.rest.transactional.TransactionHandleRegistry)1 TransitionalPeriodTransactionMessContainer (org.neo4j.server.rest.transactional.TransitionalPeriodTransactionMessContainer)1