Question: what is the difference between opensession and closed session?
Answer: openSession : When you call SessionFactory. openSession , it always creates a new Session object and give it to you. You need to explicitly flush and close these session objects. ... getCurrentSession , it creates a new Session if it does not exist, otherwise use same session which is in current hibernate context.