0 Replies Latest reply on Nov 14, 2011 12:26 PM by Anton K

    JBoss cache. Concurrency issue

    Anton K Newbie

      I'm using JBossCache 'Malagueta' 3.2.0.GA

      I faced with strange issue in production environment, sometimes writes to jboss are lost. I tried to reproduce this situation with simple java application

      public static void testCache() {
      Cache cache = new DefaultCacheFactory().createCache(false);
      final Node node = cache.getRoot().addChild(Fqn.fromString("/child1"));
      int threadsCount = 20;
      final CyclicBarrier b = new CyclicBarrier(threadsCount);
      for (int i = 0; i < threadsCount; i++) {
      final long j = i;
      new Thread(new Runnable() {
      public void run() {
      try {
      String name = RandomGenerator.getRandomName(4);
      .put(j, name);
      String nameFromCache = (String) node.get(j);
      if (!name.equals(nameFromCache)) {
      } catch (Exception e) {

      From time to time, this test output "error", which i run from static void mai. 1 of 3 runs return "error" msg, node simply return "null".  I can't reproduce it on every machine