[jboss-user] [JBoss Cache Users] - Null element in the Vector

roman.mandeleil@gmail.com do-not-reply at jboss.com
Sat Nov 21 16:32:05 EST 2009


I am chasing after a strange issue in pojo cache: 
There is a Vector that I am using it as a queue
one Thread is pushing things into the tail and 
the other poping the head of the Vector.

The Vector is being aspectize with the following 
configuration (pojocache-aop.xml): 


  | <?xml version="1.0" encoding="UTF-8"?>
  | <!--
  |     This is a variant of jboss-aop.xml. 
  | -->
  | <aop> 
  |    <!-- If a POJO has a Replicable annotation, it will be asepectized. -->
  |    
  |    <!-- 
  |    Supports inheritance and polymorphism. It can either be a concrete class
  |    or an interface. All sub-classes or interface implementors will be 
  | 
  | instrumeneted.
  |    -->
  |    <prepare expr="field(* $instanceof
  | 
  | {@org.jboss.cache.pojo.annotation.Replicable}->*)" />
  |    
  |    <!--  Work around that ensures annotated classes which do not access 
  | 
  | fields are instrumented -->
  |    <introduction expr="class($instanceof
  | 
  | {@org.jboss.cache.pojo.annotation.Replicable})"/>
  | 
  |    <!-- Array support -->
  |    <!-- Comment entire section to disable    --> 
  |    <arrayreplacement expr="class($instanceof
  | 
  | {@org.jboss.cache.pojo.annotation.Replicable})"/>
  |    <interceptor name="pojocache-array" 
  | 
  | class="org.jboss.cache.pojo.interceptors.dynamic.ArrayInterceptor"/>
  |    <introduction expr="class($instanceof
  | 
  | {@org.jboss.cache.pojo.annotation.Replicable})">
  |        <interfaces>org.jboss.cache.pojo.impl.ArrayInterceptable</interfaces>
  |    </introduction>
  |    <arraybind name="pojocache-array" type="READ_WRITE">
  |       <interceptor-ref name="pojocache-array"/>
  |    </arraybind>
  | 
  | </aop>
  | 


I have tried different cache configurations, the last one is like this:


  | Configuration config = new Configuration();
  | 	    config.setTransactionManagerLookupClass( JBossTransactionManagerLookup.class.getName() );
  | 	    config.setIsolationLevel(IsolationLevel.SERIALIZABLE);
  | 	    config.setCacheMode(CacheMode.REPL_SYNC);
  | 	    config.setLockAcquisitionTimeout(30000);
  | 	    config.setClusterName("DefaultPartition");
  | 	    config.setConcurrencyLevel(5000);
  | 	    config.setNodeLockingScheme(NodeLockingScheme.PESSIMISTIC);
  | 
  | 

The vector is placed inside the pojo cache on JBoss 5.1.0 GA.
And then I see the following problem happens from time to time: 
I see null elements apears inside the vector when I have cirtanly 
no code that puts it there and by inspecting the logs I see 
that it happens when there is concurrent activity on the Vector.

Before I am going to open a bug on it, I would like to know if 
there is someone else that has similar expirience and maybe know
about any work around to prevent this behavior. 


Regards 
Roman


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

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



More information about the jboss-user mailing list