Quote:
1. The JavaDocs on SessionFactory.openSession() state that it "Create[s] database connection and open a Session on it. " Does it actually _create_ a connection, or does it use/reuse one from the pool?
openSession() gets a connection from a configured pool, openSession(connection) re-uses the given connection.
Quote:
2. In a servlet environment, would it be advisable to store a Session in the HttpSession, reconnecting and disconnecting the Connection when needed, instead of close()ing the Session? If not, why not?
This is possible, but not advisable. The acts also as a cache of objects and you may see stale data. It is ok to disconnect/reconnect the Session for a couple of HttpRequest/Response cycles as long as you are aware of the caching issues.