Question: When I call the method session.begin transaction as follows:

```
//session factory is instantiated via a bean
Session session = this.getSessionFactory().getCurrentSession();
session.beginTransaction();

```

Then I get the following exception message

```
6:13:52,217 ERROR [STDERR] org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:49)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1319)

```

What could be the cause of this error ?

Answer: 
I think I found the answer in:

[Session is Closed](http://www.17od.com/2006/11/06/using-managed-sessions-in-hibernate-to-ease-unit-testing/)

I am yet to implement it
This may be the reason 

```
session.close();
tx.commit();

```

The correct way would be:

```
tx.commit();
session.close();

```