Hi, heaving read hibernate docs, i get the idea but wud like a bit more clarity on few things or more of an advice rather ...
1. Does one have to always use ThreadLocal for managing Sessions on web applications? what kind of applications really need this approach 2. Say a user logs in to the system, queries an employee details from employee table, change employee's address and update. Then attempts to add a new employee to the same employee and save...Then logs out. When is the best time to close a session, after updating employee or after logging out? 3. Is the DB connection tied/created when openSession() is invoked or rather when BeginTransaction()? which really destroys/closes the connection between session.close and EndTransaction()? Maybe i don't have a clear understanding between a hibernate session and the actual transaction. 4. Read that you can keep a transaction open across multiple views (JSPs) and/or multiple actions and use it for ALL DB activities ... Is that advisable?
Thanks in advance
|