SearchFactoryImplementor searchFactoryImpl = getSearchFactoryImpl();
MockErrorHandler errorHandler = (MockErrorHandler) searchFactoryImpl.getErrorHandler();
Session s = getSessionFactory().openSession();
s.getTransaction().begin();
s.persist( new PersonWithBrokenSocialSecurityNumber( Long.valueOf( 2 ), "This guy is unaffected by identifier rollback" ) );
s.getTransaction().commit();
s.close();
s = getSessionFactory().openSession();
s.getTransaction().begin();
PersonWithBrokenSocialSecurityNumber entity = (PersonWithBrokenSocialSecurityNumber) s.get( PersonWithBrokenSocialSecurityNumber.class, Long.valueOf( 2 ) );
Assert.assertNotNull( entity );
s.delete( entity );
s.getTransaction().commit();
s.close();
Assert.assertNull( "unexpected exception detected", errorHandler.getLastException() );