I'm trying to test my code using Spring and DBunit (http://springtestdbunit.github.io/)
Once inside the unit test:
sessionFactory.getCurrentSession().createCriteria(MyEntity.class).list()
will return the list of entities inserted by DBUnit, so it did insert records in teh database (MYSQL).
But:
sessionFactory.openStatelessSession().createCriteria(MyEntity.class).scroll(FORWARD_ONLY).next()
will return false! It can't find any records using the stateless session.
Beforehand, I use to insert the same records using Liquibase, and this piece of code worked perfectly.
Using HSql it's even worse, it totally freezes when trying to open the stateless session... (on the scroll() instruction...)
Thank you for your help!