openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: svn commit: r509688 - /incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java
Date Tue, 20 Feb 2007 19:00:51 GMT
Hi Pinaki,

Would it be possible to include the field number with the error  
message? Seems like if you get this exception you'd like to know  
which field it is complaining about.

Craig

On Feb 20, 2007, at 9:57 AM, ppoddar@apache.org wrote:

> Author: ppoddar
> Date: Tue Feb 20 09:57:24 2007
> New Revision: 509688
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=509688
> Log:
> Prevent access to the pc fields by implictly invoking _pc.toString 
> () as that may cause infinite loop if toString() again tries to  
> access unloaded field(s)
>
>
> Modified:
>     incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/ 
> openjpa/kernel/DetachedStateManager.java
>
> Modified: incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/ 
> apache/openjpa/kernel/DetachedStateManager.java
> URL: http://svn.apache.org/viewvc/incubator/openjpa/trunk/openjpa- 
> kernel/src/main/java/org/apache/openjpa/kernel/ 
> DetachedStateManager.java?view=diff&rev=509688&r1=509687&r2=509688
> ====================================================================== 
> ========
> --- incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/ 
> openjpa/kernel/DetachedStateManager.java (original)
> +++ incubator/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/ 
> openjpa/kernel/DetachedStateManager.java Tue Feb 20 09:57:24 2007
> @@ -396,8 +396,10 @@
>
>      public void accessingField(int idx) {
>          if (!_access && !_loaded.get(idx))
> +        	// do not access the pc fields by implictly invoking  
> _pc.toString()
> +        	// may cause infinite loop if again tries to access  
> unloaded field
>              throw new IllegalStateException(_loc.get("unloaded- 
> detached",
> -                _pc).getMessage());
> +                _pc.getClass()+"@"+System.identityHashCode 
> (_pc)).getMessage());
>      }
>
>      public boolean serializing() {
>
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message