Pessoal,
Alguém já teve problemas de tipo, o tomcat simplesmente “para” a cada dois ou três dias?
Já analisei os logs, o logs estão crescendo bastante, esse é o principal erro acusado, por isso desconfio de algum problema no meu filtro de conexão, poderia ser?
Erro apontado no log:
org.hibernate.TransactionException: rollback failed
Esse é o meu filtro usando Open View in Session:
imports...
public class ConexaoHibernateFilter implements Filter {
private SessionFactory sf;
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
try {
this.sf.getCurrentSession().beginTransaction();
chain.doFilter(servletRequest, servletResponse);
this.sf.getCurrentSession().getTransaction().commit();
} catch (StaleObjectStateException ex) {
throw ex;
} catch (Throwable ex) {
ex.printStackTrace();
try {
if(this.sf.getCurrentSession().getTransaction().isActive()){
this.sf.getCurrentSession().getTransaction().rollback();
}
} catch (Throwable rbEx) {
System.out.println("Could not rollback transaction after exception: ERRO: " + rbEx);
}
throw new ServletException(ex);
} finally {
if(this.sf.getCurrentSession().isOpen() || this.sf.getCurrentSession() != null){
this.sf.getCurrentSession().close();
}
}
}
public void init(FilterConfig config) throws ServletException {
this.sf = HibernateUtil.getSessionFactory();
}
public void destroy() {
}
}