2 Replies Latest reply on Jun 9, 2011 2:08 AM by viewtifulced

    Explication about multithreading and JTA

    viewtifulced

      Hi,

       

      I'm working with Infinispan 4.2.1 FINAL. My application run 2 nodes in REPL_SYNC mode.

       

      Each node is associated  with an application taking a data on Infinispan, make treatment and push data on the cache.

       

      A simulator send 100 simultaneous thread to make teatment by application 1 (node 1) or appplication 2 (node 2). If I run the simulator with 1 thread no problem all data are coherent. If I run the simulator with more of 1 thread i have "replication timeout", "unable to acquire lock".... my configuration is:

       

      conf.setCacheMode(CacheMode.REPL_SYNC);
      conf.setLockAcquisitionTimeout(70000);
      conf.setL1CacheEnabled(false);
      conf.setConcurrencyLevel(500);
      conf.setTransactionManagerLookupClass("org.infinispan.transaction.lookup.GenericTransactionManagerLookup");
      conf.setFetchInMemoryState(true);

       

      I have tried multiple configuration or other CacheMode but if Infinispan does not generate exception then the treatment is very low.

       

      My last solution is to use an alternative Transaction manager like JBoss Transaction Manager or Atomikos to coordonate Threads (but how?). My application is NOT in a j2EE server.

       

      Thank you in advance for your help!

        • 1. Re: Explication about multithreading and JTA
          mircea.markus

          what access pattern do you have? Are all the threads working on the same set of keys? if that's the case the Timouts should be expetced as deadlocks might happen. Switching to a new transaction manager won't solve the problem. One thing you can do though is enabled deadlock detection.

          1 of 1 people found this helpful
          • 2. Re: Explication about multithreading and JTA
            viewtifulced

            I don't use access pattern actually, I will look in this way.Yes all the threads working on the same set of keys. I have tried with deadlock detection and deadlock are found. I thought using another manager would help to control data but definitively not..

             

            Thanks for your help. I'm trying with an access pattern.