コード例 #1
0
ファイル: ProcessStoreImpl.java プロジェクト: rrialq/ode
 /**
  * Execute database transactions in an isolated context.
  *
  * @param <T> return type
  * @param callable transaction
  * @return
  */
 synchronized <T> T exec(Callable<T> callable) {
   // We want to submit db jobs to an executor to isolate
   // them from the current thread,
   Future<T> future = _executor.submit(callable);
   try {
     return future.get();
   } catch (Exception e) {
     throw new ContextException("DbError", e);
   }
 }
コード例 #2
0
ファイル: ProcessStoreImpl.java プロジェクト: rrialq/ode
 public void shutdown() {
   if (_inMemDs != null) {
     shutdownInternalDB(_inMemDs);
     _inMemDs = null;
   }
   if (_executor != null) {
     _executor.shutdownNow();
     _executor = null;
   }
 }