protected static void clearCache(Session mainSession) {
   mainSession.getIdentityMapAccessor().initializeAllIdentityMaps();
 }