0 Replies Latest reply on Oct 13, 2004 9:59 AM by michael293

    UserTransaction in clustered environment

    michael293

      Hello,

      Please forgive me if the answer is elsewhere, as I have been searching for a day and half, and come up empty. Also, I have posted here because I believe it is very specific to clustering. So here it is, for you kind folks :-).

      I am having a problem specifically in a clustered environment, and not just a clustered configuration (i.e. one node with clustered conf), it must be more than one host.

      I have a single threaded client application, using EJB's and the UserTransaction object. A transaction is instantiated, and a sequence of dependant operations are performed. What happens is that the application deadlocks (remember, single threaded). After about five minutes both nodes on my two node cluster report this deadlock on two different entities, one that my program modified earlier, and the one that it is stuck on.

      I had thought that UserTransaction would ensure requests would be targeted at a single VM once it is initiated, but this does not seem to be happening, and I believe this is the cause of the problem. But I can't find a solution.

      I have been digging through the jboss source code, and from what I see it does load balance even when there is an active client side initiated transaction. Am I wrong about this?

      Here is a code snippet. I appologise, but it is all working though abstracted API's. I hope you get the idea.

      UserTransaction tx = factoryFactory.getUserTransaction();
      tx.begin();
      try {
      AssetTypeID assetTypeID = createAssetType("cluster_tx_1", false).getID();
      service.lock();
      try {
      service.addAssetType(assetTypeID);
      } finally {
      service.unlock();
      }
      createAsset("cluster_tx_1", assetTypeID, false);
      } finally {
      tx.rollback();
      }

      It's not really important where it locks, but it's not on the first statement, and it doesn't get to the rollback statement (for the curious, it's on the lock statement). Again, no other applications are running, this can not be deadlocking against anything else.

      My software comprises of:
      JBoss 3.2.5
      Oracle 8.1.7 (using the default jdbc driver, not the thin)
      Java 1.4.2

      To configure it, I followed the clustering docs that my company purchased from here. Mostly things work well, and we are happy with it, it's just this UserTransaction problem that is giving us a headache.

      I am not sure what config files to post, so I'll wait until somebody asks for a specific one (there are lots after all).

      I hope it's something simple, just a configuration issue.

      Any ideas?..

      Many thanks,

      Michael@AssetHouse