public void testTransactionalOperationsWhenExtended() throws Exception {
Book book = new Book();
book.name = "Le petit prince";
EntityManager em = getOrCreateEntityManager();
Statistics stats = ( (HibernateEntityManagerFactory) factory ).getSessionFactory().getStatistics();
stats.clear();
stats.setStatisticsEnabled( true );
em.persist( book );
assertEquals( 0, stats.getEntityInsertCount() );
em.getTransaction().begin();