|
Hibernate version:2.0
Name and version of the database you are using:mssql 2000
Sometimes when I execute session.getConnection(),hibernate will connect to db again and
hibernate will warm me that database changed to XXX.
Why?
I use ThreadLocal to manange a same db session.
SessionFactory is singleton.
When I close connection ,I execute connection.close() and remove session from ThreadLocal .
One of my servlets invoke 20 database,if one of databases appears this hibernate's warm,servlet's speed will be much slow.
|