Code reviewed by toplink team.
Problem Description:
When deleting an object outside of JPA that has already been read in through the entitymanager, EM.refresh(object) throws javax.persistence.EntityNotFoundException: Entity no longer exists as expected. But the refresh could/should also inactive the object stored in the shared cache which force the object being extracted late on from database
rather than from shared cache.
Fix detail:
Added inactive deleted object from shared cache code in EM.refresh method.
Test:
Passed entity-persistence-tests test.
New test case testRefreshInvalidateDeletedObject has been added into oracle.toplink.essentials.testing.tests.cmp3.advanced.EntityManagerJUnitTestSuite
cheers
kyle