mirror of https://github.com/apache/openjpa.git
OPENJPA-836 after em.clear the datacache is inconsistent
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@734551 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b65b9b2471
commit
1583426e01
|
@ -269,8 +269,17 @@ public class PCDataImpl
|
|||
return;
|
||||
|
||||
int index = fmd.getIndex();
|
||||
OpenJPAStateManager dsm = null;
|
||||
if (sm.getPersistenceCapable().pcIsDetached()) {
|
||||
dsm = (DetachedStateManager) sm.getPersistenceCapable().
|
||||
pcGetStateManager();
|
||||
sm.getPersistenceCapable().pcReplaceStateManager(sm);
|
||||
}
|
||||
|
||||
Object val = toData(fmd, sm.fetchField(index, false),
|
||||
sm.getContext());
|
||||
if (dsm != null)
|
||||
sm.getPersistenceCapable().pcReplaceStateManager(dsm);
|
||||
if (val != NULL)
|
||||
setData(index, val);
|
||||
else // unable to store field value; clear out any old values
|
||||
|
|
Loading…
Reference in New Issue