Hibernate: openSession vs getCurrentSession



What is the recommended approach of openSession vs getCurrentSession?

In Hibernate, there is factory.openSession() and
factory.getCurrentSession(). To make getCurrentSession() to work, we
could set hibernate.current_session_context_class to 'thread' and
hibernate.transaction.factory_class to
org.hibernate.transaction.JDBCTransactionFactory.

Will that cut it in a "production" environment?

If we do the above approach then it appears that we'd never call
openSession nor session.close().

.