Hello,
i have an SessionFactory registered in jboss jndi. But when i trie to open a new session based upon an existing connection via following code:
Code:
Sesson s = sessionFactory.openSession(sessionFactory.getCurrentSession().connection());
the session doesn't use th existing connection(-pool?), but opens always an new connection to the database --> resulting that the application reaches the db-connection-limit shortly.
Is this a bug ?
The connection-Pool is only used, if i use the existingSession via:
Code:
return sessionFactory.getCurrentSession();
[Jboss 4.0.5 GA]
[EntityManager 3.2.0]