Author: dwoods
Date: Wed Mar 31 14:33:02 2010
New Revision: 929550

URL: http://svn.apache.org/viewvc?rev=929550&view=rev
Log:
OPENJPA-1597 merge in code comment updates from 2.0.x branch

Modified:
    
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java

Modified: 
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java
URL: 
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java?rev=929550&r1=929549&r2=929550&view=diff
==============================================================================
--- 
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java 
(original)
+++ 
openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/util/Proxies.java 
Wed Mar 31 14:33:02 2010
@@ -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;


Reply via email to