To solve the issue I had to do 2 actions: 1. Create a new session for every query 2. Clear the cache use the command: hbmFactory.getCache().evictAllRegions();