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: 
Instead of closing the session completely, you can use `session.disconnect()`, do some other work, then `session.reconnect()` before doing other transactions.

`session.close()` would be called at the very end of the request / business process.

In Hibernate 2.1.8 we have been using the one session per request model and it works well, avoiding session leaks, etc.

See [here](https://docs.atlassian.com/hibernate2/2.1.8/reference/transactions.html) for some elaboration
The following solution worked for me:

```
@SuppressWarnings("unchecked")
public List<Enfermedad> obtenerEnfermedadesOrderByProcal() throws HibernateException {
    if (session==null)
        session = HibernateUtil.getSession();
    if (!session.isOpen())
        session = HibernateUtil.getSession();
    return session.createQuery("FROM Enfermedad AS e ORDER BY e.ordenPROCAL, e.id").list();
}

```