Fixed Hibernate queries getting stuck waiting