@Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { long before = System.currentTimeMillis(); try{ Base.open(jndiName); Base.openTransaction(); chain.doFilter(req, resp); Base.commitTransaction(); } catch (IOException e){ Base.rollbackTransaction(); throw e; } catch (ServletException e){ Base.rollbackTransaction(); throw e; } finally{ Base.close(); } LOGGER.info("Processing took: {} milliseconds", System.currentTimeMillis() - before); }
@Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { long before = System.currentTimeMillis(); try{ Base.open(jndiName); Base.openTransaction(); chain.doFilter(req, resp); Base.commitTransaction(); } catch (IOException e){ Base.rollbackTransaction(); throw e; } catch (ServletException e){ Base.rollbackTransaction(); throw e; } finally{ Base.close(); } LOGGER.info("Processing took: {} milliseconds", System.currentTimeMillis() - before); }
@Override public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { long before = System.currentTimeMillis(); try{ Base.open(jndiName); Base.openTransaction(); chain.doFilter(req, resp); Base.commitTransaction(); } catch (IOException e){ Base.rollbackTransaction(); throw e; } catch (ServletException e){ Base.rollbackTransaction(); throw e; } finally{ Base.close(); } logger.info("Processing took: {} milliseconds", System.currentTimeMillis() - before); }
/** * @param command command to execute. */ @Override public <T extends Command> void onCommand(T command) { try { if(jndiConnection != null){ Base.open(jndiConnection); }else{ Base.open(); } Base.openTransaction(); command.execute(); Base.commitTransaction(); } catch (Exception e) { try { if (Base.hasConnection()) { Base.rollbackTransaction(); } } catch (Exception ignore) {} onException(command, e); } finally { try { Base.close(); } catch (Exception ignore) {} } }
/** * @param command command to execute. */ @Override public <T extends Command> void onCommand(T command) { try { if(jndiConnection != null){ Base.open(jndiConnection); }else{ Base.open(); } Base.openTransaction(); command.execute(); Base.commitTransaction(); } catch (Exception e) { try { if (Base.hasConnection()) { Base.rollbackTransaction(); } } catch (Exception ignore) {} onException(command, e); } finally { try { Base.close(); } catch (Exception ignore) {} } }