OPENJPA-680. Consistent with the beforeRefresh call check for new unflushed instances

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@683805 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Srinivasa Segu 2008-08-08 02:42:36 +00:00
parent b53a58f948
commit 4668ea4e77

View File

@ -362,7 +362,7 @@ public class StateManagerImpl
*/
protected boolean load(FetchConfiguration fetch, int loadMode,
BitSet exclude, Object sdata, boolean forWrite) {
if (!forWrite && (!isPersistent() || isNew() || isDeleted()))
if (!forWrite && (!isPersistent() || (isNew() && !isFlushed()) || isDeleted()))
return false;
// if any fields being loaded, do state transitions for read