fixed wrong document dirty flag set during object getter access
@@ -78,6 +78,7 @@ public class OObjectProxyMethodHandler implements MethodHandler {
protected final Set<ORID> orphans = new HashSet<ORID>();
protected ODocument doc;
protected ProxyObject parentObject;
+ protected boolean reading;
public OObjectProxyMethodHandler(ODocument iDocument) {
doc = iDocument;
@@ -291,6 +292,7 @@ public class OObjectProxyMethodHandler implements MethodHandler {
protected Object manageGetMethod(final Object self, final Method m, final Method proceed, final Object[] args)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException, SecurityException,
IllegalArgumentException, NoSuchFieldException {
+ this.reading =true;
final String fieldName = OObjectEntityEnhancer.getInstance().getMethodFilter(self.getClass()).getFieldName(m);
final ORID docRID = doc.getIdentity();
@@ -313,7 +315,7 @@ public class OObjectProxyMethodHandler implements MethodHandler {
loadedFields.put(fieldName, doc.getVersion());
else
loadedFields.put(fieldName, 0);
-
+ this.reading =false;
return value;
}
@@ -775,9 +777,11 @@ public class OObjectProxyMethodHandler implements MethodHandler {
protected Object manageSetMethod(final Object self, final Method m, final Method proceed, final Object[] args)
throws IllegalAccessException, InvocationTargetException {
+ if(!reading){
final String fieldName;
fieldName = OObjectEntityEnhancer.getInstance().getMethodFilter(self.getClass()).getFieldName(m);
args[0] = setValue(self, fieldName, args[0]);
+ }
return proceed.invoke(self, args);
}
