[jboss-user] [JBoss Cache: Core Edition] - Re: Error function when working with passivation.

kenees do-not-reply at jboss.com
Sat Dec 27 10:05:41 EST 2008


It seems no body care about my problem :(

Anyway, I'm still doing the test and finally find that whenever I write the following code in my run() method of the reader Thread, the reader has a big chance to get null from a specific node which should have value, the code is:
@Override
  |     public void run() {
  |         while(true) {
  |             try {
  |                 Thread.sleep(1000);
  |             } catch (InterruptedException e) {
  |                 // TODO Auto-generated catch block
  |                 e.printStackTrace();
  |             }
  |             int max = w.getKey();
  |             Node<String, TestBean> regionNode = cache.getNode(Fqn.fromString(region)); // just a test to check the root node of my test
  |             max = regionNode.getChildren().size();
  |             logger.info("currently node (/testRegion) has " + max + " subnodes");
  |             int readPoint = Math.abs(RANDOM.nextInt() % (max == 0 ? 1 : max));
  |             if (readPoint == 0) {
  |                 readPoint = 1;
  |             }
  |             testRegion = Fqn.fromString(region + "/" + readPoint);
  |             TestBean value = cache.get(testRegion, "DATA");
  |             logger.info("Get value ++++++++++++++ '" + value + "' in node '" + testRegion.toString() + "'.");
  |             logger.info("/n/n/n");
  |         }
  |     }

Please pay attention to the red color, it seems has a significant impact to the passivation Thread, when it was uncommented, my reader thread will get nothing. When this part of code (the red part) was removed, everything is OK.

Can anybody give me some clues about it, any response will be appreciated.

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

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



More information about the jboss-user mailing list