void closeEnvironment() { environment.close(); environment = null; }
public T doInTransaction(TransactionStatus status) { Environment environment = environmentFactory.openEnvironment(); try { return command.execute(environment); } catch (Exception e) { throw new RuntimeException("ooops", e); } finally { environment.close(); } }
public <T> T execute(Command<T> command) { Environment environment = environmentFactory.openEnvironment(); try { return next.execute(command); } finally { environment.close(); } }
public <T> T execute(Command<T> command) { Environment environment = environmentFactory.openEnvironment(); try { log.debug("executing command " + command); return command.execute(environment); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new EJBException("failed to execute command " + command, e); } finally { environment.close(); } }
return evaluate(scriptEngine, script); } finally { environment.close();