Skip to content

Commit

Permalink
Don't extract the query on composite databases
Browse files Browse the repository at this point in the history
  • Loading branch information
knutwalker committed Nov 20, 2023
1 parent 3fa65aa commit 7b4175c
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@ public CompatUserAggregator create(Context ctx) throws ProcedureException {
var metricsFacade = Neo4jProxy.lookupComponentProvider(ctx, MetricsFacade.class, true);
var username = Neo4jProxy.lookupComponentProvider(ctx, Username.class, true);
var transaction = Neo4jProxy.lookupComponentProvider(ctx, Transaction.class, true);
var ktxs = GraphDatabaseApiProxy.resolveDependency(databaseService, KernelTransactions.class);
var queryProvider = ExecutingQueryProvider.fromTransaction(ktxs, transaction);

var runsOnCompositeDatabase = Neo4jProxy.isCompositeDatabase(databaseService);

ExecutingQueryProvider queryProvider;
if (runsOnCompositeDatabase) {
queryProvider = ExecutingQueryProvider.empty();
} else {
assert GraphDatabaseApiProxy.containsDependency(databaseService, KernelTransactions.class);
var ktxs = GraphDatabaseApiProxy.resolveDependency(databaseService, KernelTransactions.class);
queryProvider = ExecutingQueryProvider.fromTransaction(ktxs, transaction);
}

var writeMode = runsOnCompositeDatabase
? WriteMode.NONE
: WriteMode.LOCAL;
Expand Down

0 comments on commit 7b4175c

Please sign in to comment.