4 Replies Latest reply on May 24, 2006 6:09 AM by Marc Reis

    JBossTS and JBossCache

    Marc Reis Novice

      I am looking into setting up a JBoss cluster and now have some questions about transactions in this context. I looked into most of the documentation about the JBossTS, but still have some generall questions that are not clear to me (might have just missed it) .
      In an cluster environment (JBoss 4.0.4.RC2/GA), we will use a hibernate session within ejb 3 's to access the db and controll the transactions. This will use the jdbc transaction (as far as I have understood this from the hibernate side). When I set up a second level Cache (TreeCache or TreeCacheAop) for Hibernate, how will this affect transactions ? What is not clear to me is, if I need to use JBossTS (when it comes for 4.0.4) when setting up a 2nd lvl Cache for Hibernate. I thought so, since the TreeCache can be used across VM and the default JBoss Transactions dont work across VM's. I dont realy see what would be the best/securest aproach. Should I always use the JBossTS in a Clusterd enviornment ?


        • 1. Re: JBossTS and JBossCache
          Mark Little Master

          JBossTS does not support JBossAS 4.0.4 yet.

          • 2. Re: JBossTS and JBossCache
            Marc Reis Novice

            Hi Mark,
            thanks for the reply !
            Sorry that I have expressed myseld unclear, I knew that it is only available for 4.0.3 (Sp1), since I also read in this Forum prior to my post. I just wanted to note that at the moment we are going for JBoss 4.0.4.
            My question was supposted to be more about the general aspekt of using EJB3, Hibernate-Transaktions, Caches and JBossTS in a Cluster. I thought, that the basics aspekts would be transferable in this case.

            • 3. Re: JBossTS and JBossCache
              Mark Little Master

              OK, sorry for misunderstanding. In that case, in general you need to make sure that all entities that are using (reading or writing) data that is accessed within a transaction share that transaction context. I haven't had a chance to look at how Hibernat or TreeCache use transactions, but I'd assume they do so via JTA and either register XAResources or Synchronizations, depending on the type of participant. In that case, you should be OK with replacing the local (single VM) JTA implementation with the JTS implementation and it should just work (tm).