I've got jsp webapp on my VPS host with tomcat 7 as server. I'm using Hibernate 3 and PostgreSQL. All methods in my class DBManager (responsible for db services, connection, queries) use almost the same structure:

```
 Session session = sessionFactory.openSession();
    session.beginTransaction();
    =======
    HERE HQL QUERY/session.get/update/save etc are executed
    =======
    session.getTransaction().commit();
    session.close();

```

The problem is that my VPS after some time (using my webapp) shows many idle postgres processes which causes server overloading and e.x VPS kills Java or refuses connection to DB. What can I do to remove the problem? Is this a problem caused by my code or something else?