2 Replies Latest reply on Jan 26, 2006 5:53 PM by stelang

    weblogic transactions with jbosscache

    stelang

      Hi,
      I am a new user of jbosscache1.2.3 and am trying to use it with weblogic.
      For using transaction with weblogic, what TransactionManager or rather TransactionManagerLookupClass should I specify in my treecache configuration file?
      At the moment, I am doing the following in a servlet deployed in weblogic:
      Environment env = new Environment();
      Context ctx = env.getInitialContext();
      UserTransaction tx=(UserTransaction)ctx.lookup("javax.transaction.UserTransaction");
      tx.begin();
      cache.put(node, name, val);
      tx.commit();

      Is this the right way to use transaction with jbosscache and weblogic?
      I also noticed that, other than Dummy, there is 1 more txnManager available -org.jboss.cache.GenericTransactionManagerLookup. Can this be used with weblogic? I cannot use the Dummy transaction manager since my application will be deployed across multiple jvms.
      Really appreciate your help. Thanks in advance.

        • 1. Re: weblogic transactions with jbosscache
          manik

          Try using the GenericTransactionManagerLookup in your JBossCache configuration. This should detect the WebLogic transaction manager.

          Regarding your code, looking up a UserTransaction is the correct way to get a hold of a transaction instance so this is correct as well.

          • 2. Re: weblogic transactions with jbosscache
            stelang

            Thanks for your response.
            So, my understanding is I should set TransactionManagerLookupClass to org.jboss.cache.GenericTransactionManagerLookup in the tree cache configuration file and access this transaction with:
            UserTransaction tx=(UserTransaction) new InitialContext().lookup("javax.transaction.UserTransaction");
            Is this correct? Thanks again.