Hi everyone:
I'm using Hibernate 3.2.5 with MySql 5.1. I'm building a Web app using J2EE and Tomcat. I put in a servlet the next test code
Session sesion = HibernateUtil.getSessionFactory().openSession();
sesion.beginTransaction();
Usuario usr = new Usuario();
UsuarioHome usrDal = new UsuarioHome();
usr = usrDal.findById("ff8081811dd7e638011dd7e76b910002", sesion);
sesion.getTransaction().commit();
This works prefectly, the problem is that, when I see the MySQL Administrator Client in the "Server Connections" tab, I see that after I execute my servlet, two more connections are generated, but they don't dissapear, instead they appear as "sleep". If I do a sesion.close() I get an exception because it says that commit() already closed the sesion.
So, the question is... is it normal that mySQL keep this connections??, do I have to configure something in my Hibernate mappings, MySql or Tomcat.
Any advice would be appreciated. Thank You in advance for your time.
|