As far as I know, my server isn't yet capable of thread dumps :(
However, I have another theory as to why threads keep getting stuck. If I have a thread of execution which opens a Session object by SessionFactory.openSession(), does its transaction/criteria lookup, then explicitly closes the session with Session.close(), and then the same thread looks to do another operation, could that cause it?
EG: Let's say I have a validation service that validates which user is asking for what from the server. When the user's call is issued, Hibernate does a check to see if the user is valid against the DB. This is achieved by the following code:
Code:
Session session = this.getSessionFactory().openSession();
Criteria criteria = session.createCriteria(MyUser.class);
criteria.add(Restrictions.eq("username", user.getUsername());
criteria.add(Restrictions.eq("password", user.getPassword());
criteria.uniqueResult();
session.close();
If the user is validated, the thread continues on, otherwise it returns. When it continues, it does another similar select from the database, perhaps for a different type of object, but still. At the end of THAT transaction, the session is again closed with Session.close().
Would this scenario freeze up the connection pool and disallow sessions from being opened? I'm going to try and investigate this, in the meantime.