Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

consequence of session left open

 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys please tell me
what will happen if left Hibernate session without closing after doing a
read operation
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The object you have read will remain in memory for the lifetime of the session.
 
Amirtharaj Chinnaraj
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks paul

please tell me
how to set the timeout for a session in hibernate
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no such thing as a timeout in a Hibernate session.

There are session management patterns you can use that are appropriate for different situations. Why do you not currently close your session?
 
Angel Taveras
Ranch Hand
Posts: 84
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There it's no session timeout but if you're using a good transaction mgr then the transaction could release the resources allocated in the session.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic