I downloaded the latest code, and it solved the problem I had, but I ran into a 
new problem.
I added a single field to MySimpleObject class:

    private StatusEnum  status = StatusEnum.OPEN;

where StatusEnum is:

   public enum StatusEnum {
        OPEN,
        CLOSE
   }

When I attempt to change this field's value like this:
status = StatusEnum.CLOSE; (after MySimpleObject is cached), I get this 
exception:

java.lang.RuntimeException: TreeCacheAopDelegate.putObject(). There is existing 
pojo under fqn /MyObject/1/status Operation not allowed.
        at 
org.jboss.cache.aop.TreeCacheAopDelegate.retrieveCurrentValue(TreeCacheAopDelegate.java:103)
        at 
org.jboss.cache.aop.TreeCacheAopDelegate._putObject(TreeCacheAopDelegate.java:152)
        at org.jboss.cache.aop.TreeCacheAop._putObject(TreeCacheAop.java:371)
        at org.jboss.cache.aop.TreeCacheAop.putObject(TreeCacheAop.java:222)
        at org.jboss.cache.aop.CacheInterceptor.invoke(CacheInterceptor.java:97)
        at 
org.jboss.aop.joinpoint.FieldWriteInvocation.invokeNext(FieldWriteInvocation.java:51)
        at cachetest.MySimpleObject.status_w_$aop(MySimpleObject.java)
        at cachetest.MySimpleObject.setCrossReferences(MySimpleObject.java:24)
        at 
cachetest.SelfReferencingObjectsCacheTest.main(SelfReferencingObjectsCacheTest.java:21)

There seems to be a restriction preventing me from changing a cached field. Is 
it a temporary restriction (there is a TODO comment in the code). If it's 
permanent, is there any work around? 

Thanks a lot for all your help!

Just in case, this is the new MySimpleObject.java:
---------------------------------------------------------
package cachetest;

import java.util.ArrayList;
import java.util.List;

public class MySimpleObject  {
   
    private String               id = null;
    private StatusEnum          status = StatusEnum.OPEN;
    private List  decendants = new ArrayList();     // reference to objects of 
the same class
    
    public String getId() {
        return id;
    }
    
    public void setId(String anID) {
        id = anID;
    }

    public MySimpleObject    setCrossReferences() {        
        MySimpleObject retVal = new MySimpleObject();
        retVal.setId(getId() + "_copy");
        decendants.add(retVal);
        status = StatusEnum.CLOSE;
        return retVal;
    }
}



View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3891539#3891539

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3891539


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
JBoss-user mailing list
JBoss-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to