Should getCurrentSession be closed manually?

S

santax

Hi
The book "Java Persistence with Hibernate" referce to “OSIVâ€ï¼ˆOpen
Session in Vies).
Session was get by getCurrentSession in this pattern.
They said the session get by this way is binding to the Thread ,Does
this mean the session will open and close automaticlly ? If the thread
finished , the session will close automaticlly and don't need be
closed manually?
Thanks.
 
N

nileshjani

Hi
The book "Java Persistence with Hibernate" referce to “OSIVâ€ï¼ˆOpen
Session in Vies).
Session was get by getCurrentSession in this pattern.
They said the session get by this way is binding to the Thread ,Does
this mean the session will open and close automaticlly ? If the thread
finished , the session will close automaticlly and don't need be
closed manually?
Thanks.


Hi

from my knowleadge. session is auto close/open on thread basic, but
when there is single thread this time session management sholud
be manullly.

Regards
Nilesh jani
 
S

santax

Hi

from my knowleadge. session is auto close/open on thread basic, but
when there is single thread this time session management sholud
be manullly.

Regards
Nilesh jani


As I am developing a webapp and use getCurrentSession on every
request,I need not close the session manulllay. Right?
Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top