From 0df0c0142ff78f73934a03cdbc4655eeebbc0bc7 Mon Sep 17 00:00:00 2001 From: Donald Woods Date: Wed, 31 Mar 2010 14:33:02 +0000 Subject: [PATCH] OPENJPA-1597 merge in code comment updates from 2.0.x branch git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@929550 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/util/Proxies.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java b/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java index 9f64c8462..ae273779f 100644 --- a/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java +++ b/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java @@ -87,15 +87,6 @@ public class Proxies { * 1) No Proxy, then return as-is * 2) Runtime created proxy (!detachable), then unproxy * 3) No StateManager (DetachedStateField==false), then return as-is - * 4) If detached, then unproxy - * 5) If ClassMetaData exists and DetachedStateField != TRUE - * (default of DetachedStateField==transient), then unproxy - * 6) Else, return as-is - * - * Original code - - * 1) Runtime created proxy (!detachable), then unproxy - * 2) No Proxy, then return as-is - * 3) No StateManager (DetachedStateField==false), then return as-is * Get the new IgnoreDetachedStateFieldForProxySerialization * Compatibility flag from either the metadata/configuration if * this is a normal StateManager, otherwise use the new flag @@ -109,6 +100,14 @@ public class Proxies { * 5a) If detached, then do not unproxy and return as-is * 5b) Else, unproxy * + * Original code - + * 1) Runtime created proxy (!detachable), then unproxy + * 2) No Proxy, then return as-is + * 3) No StateManager (DetachedStateField==false), then return as-is + * 4) If detached, then return as-is <--- ERROR as EM.clear() marks + * entity as detached but doesn't remove any $proxy usage + * 5) Else, unproxy + * * if (detachable && (proxy == null || proxy.getOwner() == null * || proxy.getOwner().isDetached())) * return proxy;