4 Replies Latest reply on Jun 4, 2008 10:57 AM by manik

    Problem using Non-JTA Transaction Manager

    mlamdin

      We are seeking advice for sharing 2nd-level cache between cluster nodes using Tomcat, Spring, and Hibernate. If you have been successful doing this, we'd appreciate hearing from you.
      We'd also appreciate learning about dead-ends we might avoid.

      Our configuration:
      -- Tomcat 6.0.14
      -- Spring 2.0.4
      -- Hibernate 3.2.5
      -- Spring-supplied HibernateTransactionManager
      -- JBoss Cache 1.4.1.SP9 (JBC)

      Our experiences to date:
      -- pessimistic locking and replication sync work well, except under
      moderate load where we get ReplicationException's and missing
      updates to the database.
      -- async and invalidation_sync did not replicate our caches correctly

      Specific questions we have:

      Will it be possible to use JBC reliably using a non-JTA transaction manager such as HibernateTransactionManager?

      If a JTA transaction manager should be used, which one would you recommend?

      Thanks in advance for your help.

        • 1. Re: Problem using Non-JTA Transaction Manager
          manik
          • 2. Re: Problem using Non-JTA Transaction Manager
            mlamdin

            Manik,

            We looked at that page, and unfortunately we still have some questions. Specifically:

            * Is the setup in our first post viable - can we do pessimistic locking reliably with a Spring non-JTA transaction manager and Tomcat?
            * If we do pessimistic locking, what is the recommended configuration?

            The recommended cache options are all based around optimistic locking. We realize that optimistic locking is the recommended option, and that all the documentation suggests it, but optimistic locking requires a JTA Transaction Manager - which we don't use, because we can't find a good JTA TM for Tomcat. The wiki page tells us nothing about pessimistic locking except that it does not provide as much concurrency as optimistic locking.

            Also, if pessimistic locking and a non-JTA transaction manager is NOT a viable option, what is your suggestion for what to move to as a JTA Transaction Manager? We imagine we would need to move to the JBoss Application Server instead of Tomcat as well, unless we find a good JTA TM for Tomcat - which is certainly something we're willing to consider, but given the timeframe we're on, we'd love to be able to get things up and running with our current setup and put that off for a bit if we can.

            • 3. Re: Problem using Non-JTA Transaction Manager
              jhalliday

              You can use JBossTS, the JTA transaction manager from JBoss App Server, with Tomcat. It's not (yet) officially supported and generally we'd recommend you just use JBossAS and throw away the bits you don't need instead. But if you are stuck with tomcat, check out http://anonsvn.jboss.org/repos/labs/labs/jbosstm/workspace/jhalliday/tomcat-integration/

              • 4. Re: Problem using Non-JTA Transaction Manager
                manik

                And yes, if you want to use transactions in JBC regardless of locking scheme used, you need to use a JTA compliant transaction manager. :)