• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session maintenance in Hibernate

 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

How can we maintain a session in hibernate?

Thanks.
 
Reehan Lalkhanwar
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be of some help: http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial-firstapp.html
Look at section: 1.2.5. - Startup and helpers
Here its show how a HibernateUtil can maintain the session.
 
Arjun Reddy
Ranch Hand
Posts: 629
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Reehan Lalkhan wrote:This might be of some help: http://www.hibernate.org/hib_docs/v3/reference/en/html/tutorial-firstapp.html
Look at section: 1.2.5. - Startup and helpers
Here its show how a HibernateUtil can maintain the session.


Hi,

Thanks for replying. It just says how to get a SessionFactory instance right? I want to know how we can maintain a session in hibernate.
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "maintain a Session"? Are you looking for a pattern to manage opening/closing sessions? If so, the transaction demarcated session stuff might be what you are looking for (see the documentation). Or are you looking for something such as the open session in view pattern? Or something else?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic