You shouldn't have to manually manage hibernate sessions in 95% of unit tests.
Take a look at existing unit tests in modules, which just extend BaseModuleContextSensitiveTest.
Also, you are doing session factory.getCurrentSession in your DAO code and not creating the session yourself.
-Darius
I realized that we weren't actually closing our hibernate session after we executed our query. Essentially, it was creating a new session every time it accessed the database without closing the old one. I'm assuming there is some sort of limit to how many sessions can be open and that's why it was hanging after about the 50th time (25 was actually in correct as each query was accessing the database twice with another query).
Problem solved! For anyone who may look at this if they are experiencing similar problems: Make sure to close your session after you execute the hibernate query!
--
OpenMRS Developers: http://go.openmrs.org/dev
Post: d...@openmrs.org | Unsubscribe: dev+uns...@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/