Example #1
0
  private void endSession() {
    logger.info("--    ending DaoTestCase interceptor session --");
    OpenSessionInViewInterceptor interceptor = findOpenSessionInViewInterceptor();
    if (shouldFlush) {
      try {
        interceptor.postHandle(webRequest, null);
      } catch (Exception exception) {
        if (exception instanceof HibernateJdbcException) {
          if (exception != null) {
            System.out.println(exception); // Log the exception
            // Get cause if present
            Throwable t = ((HibernateJdbcException) exception).getRootCause();

            while (t != null) {
              System.out.println("*************Cause: " + t);
              t = t.getCause();
              // procees to the next exception
              //  exception = ((SQLGrammarException)exception).get
            }
          }
        }
      }
    }
    interceptor.afterCompletion(webRequest, null);
  }
 public void postHandle(WebRequest request, ModelMap model) throws DataAccessException {
   super.postHandle(request, model);
 }
 public void preHandle(WebRequest request) throws DataAccessException {
   super.preHandle(request);
 }
 public void afterCompletion(WebRequest request, Exception ex) throws DataAccessException {
   super.afterCompletion(request, ex);
 }