Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate Session Connection Relationship

How many connection will hold for a single hibernate session where there is only one DB?

like image 214
Jammy Lee Avatar asked Dec 05 '25 07:12

Jammy Lee


1 Answers

  • 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)
like image 156
Bozho Avatar answered Dec 07 '25 21:12

Bozho