Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
2.0
Mapping documents:
Code between sessionFactory.openSession() and session.close():
public class HibernateUtil {
private static Log log = LogFactory.getLog(HibernateUtil.class);
private static final SessionFactory sessionFactory;
static {
try {
//Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (Throwable ex) {
log.error("Initial SessionFactory creation failed.", ex);
throw new ExceptionInInitializerError(ex);
}
}
public static final ThreadLocal session = new ThreadLocal();
public static Session currentSession() throws HibernateException {
Session s = (Session) session.get();
//Open a new Session, if this Thread has none yet
if (s == null) {
s = sessionFactory.openSession();
session.set(s);
}
return s;
}
public static void closeSession() throws HibernateException {
Session s = (Session) session.get();
session.set(null);
if (s != null)
s.close();
}
}
Full stack trace of any exception that occurs:
Name and version of the database you are using:
PostgreSQL 7.4.2
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I have the problem that when the application is running, sometimes, the hibernate creates a new connection, than the old connections still running, then when the number of connections are high, the pool fail.
Please i need help, how can i keep just one connection from tomcat and postgre, managed with hibernate
Thanks for all,
Julio