How many connection will hold for a single hibernate session where there is only one DB?
A:
At a given time given session will only hold one connection which you can access with the connect() method.
The connection used can be changed though using the reconnect() method.
objects
2010-07-12 07:29:48
thanks for your fast reply, and can a single session hold more than one connection for more than one DB?
Jammy Lee
2010-07-12 07:49:47
No, a session can only hold a single connection.
objects
2010-07-12 09:24:50
+1
A:
- there is one connection per session.
- the connection is opened only if the session needs to send JDBC queries
- you should avoid using the underlying connection. The
connection()
method has been deprecated. If you need to perform raw jdbc operations, use the doWork(..)` method (if your hibernate version is the latest)
Bozho
2010-07-12 07:52:10