Пример #1
0
 private javax.transaction.Transaction suspendTx(String query) {
   if (!executionEngine.isPeriodicCommitQuery(query)) return null;
   try {
     return transactionManager.suspend();
   } catch (SystemException e) {
     throw new RuntimeException("Error suspending Transaction", e);
   }
 }
Пример #2
0
 @Override
 protected ExecutionResult getResult(String query, Map<String, Object> parameters)
     throws ShellException, RemoteException, SystemException {
   GraphDatabaseAPI graphDatabaseAPI = getServer().getDb();
   ServerExecutionEngine engine = getEngine();
   if (engine.isPeriodicCommitQuery(query)) {
     TransactionManager manager =
         graphDatabaseAPI.getDependencyResolver().resolveDependency(TransactionManager.class);
     Transaction tx = manager.suspend();
     try {
       return super.getResult(query, parameters);
     } finally {
       manager.resume(tx);
     }
   } else {
     return super.getResult(query, parameters);
   }
 }