public void testEL254937() {
   EntityManager em = createEntityManager(m_persistenceUnit);
   beginTransaction(em);
   LargeProject lp1 = new LargeProject();
   lp1.setName("one");
   em.persist(lp1);
   commitTransaction(em);
   em = createEntityManager(m_persistenceUnit);
   beginTransaction(em);
   em.remove(em.find(LargeProject.class, lp1.getId()));
   em.flush();
   JpaEntityManager eclipselinkEm = (JpaEntityManager) em.getDelegate();
   RepeatableWriteUnitOfWork uow = (RepeatableWriteUnitOfWork) eclipselinkEm.getActiveSession();
   // duplicate the beforeCompletion call
   uow.issueSQLbeforeCompletion();
   // commit the transaction
   uow.setShouldTerminateTransaction(true);
   uow.commitTransaction();
   // duplicate the AfterCompletion call.  This should merge, removing the LargeProject from the
   // shared cache
   uow.mergeClonesAfterCompletion();
   em = createEntityManager(m_persistenceUnit);
   LargeProject cachedLargeProject = em.find(LargeProject.class, lp1.getId());
   closeEntityManager(em);
   assertTrue(
       "Entity removed during flush was not removed from the shared cache on commit",
       cachedLargeProject == null);
 }