Beispiel #1
0
  @Override
  protected ExtendedExecutionResult getResult(String query, Map<String, Object> parameters)
      throws ShellException, RemoteException {
    GraphDatabaseAPI graphDatabaseAPI = getServer().getDb();
    ServerExecutionEngine engine = getEngine();
    if (engine.isPeriodicCommit(query)) {
      ThreadToStatementContextBridge manager =
          graphDatabaseAPI
              .getDependencyResolver()
              .resolveDependency(ThreadToStatementContextBridge.class);
      TopLevelTransaction tx = manager.getTopLevelTransactionBoundToThisThread(true);
      manager.unbindTransactionFromCurrentThread();

      try {
        return super.getResult(query, parameters);
      } finally {
        manager.bindTransactionToCurrentThread(tx);
      }
    } else {
      return super.getResult(query, parameters);
    }
  }
Beispiel #2
0
 public void suspend() {
   graphDbTx = bridge.getTopLevelTransactionBoundToThisThread(true);
   bridge.unbindTransactionFromCurrentThread();
 }