-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Sessions and Transactions
PostPosted: Tue May 12, 2009 8:56 am 
Beginner
Beginner

Joined: Thu Sep 18, 2008 5:18 am
Posts: 28
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.