4 Replies Latest reply on Mar 19, 2009 5:26 AM by nikant

    JBC 3.0 as L2 cache on other appservers than JBossAS

    nikant

      Hi.
      I cannot find any examples of a successful set-up of JBossCache 3.0 as a second level cache for Hibernate on a Websphere 7.0 or Glassfish v2 application server.

      In my current project we are forced by company policy to use Webpshere 7.0 in the production environment. We use Glassifsh v2 for development. We are also using Hibernate 3.3.1 as JPA provider now i would like to enable the L2 cache and have found that the JBC is (theoretically) the best choice.

      But, how do I use the nice stuff like MVCC and cluster support? There is a good document called "hibernate-jbosscache-guide" but it does not cover the new functionality in JBossCache 3.0 (but probably 2.1).

      I want the following:
      - JBC 3.0 as L2 cache for Hibernate 3.3.1 on WAS 7.0 (and Glassfish v2).
      - Support a cluster of two physical application servers.(possibly using TCP)
      - Three different caches:
      -- One for refererence data entities (read only)
      -- One for "normal" enitites
      -- One for queries.
      - I want to user MVCC

      1. Is this possible?
      2. If it is, is there any good documentation or even better, an example configuration?

      Thanks / Niklas

        • 1. Re: JBC 3.0 as L2 cache on other appservers than JBossAS
          manik

          Yes this is possible, there are several discussions on the forums on the subject. Also, the guide you refer to does apply to JBC3 as well.

          • 2. Re: JBC 3.0 as L2 cache on other appservers than JBossAS
            nikant

            Thank you for answering so quickly.

            I will RTFM some more and come back with a better question. (I still persist that MVCC is not mentioned in the referenced document.)

            regards / Niklas

            • 3. Re: JBC 3.0 as L2 cache on other appservers than JBossAS
              brian.stansberry

              I don't think Manik's intent was to say "RTFM, JBC 3 details are covered in the guide." Rather its just that the info in the hibernate-jbosscache-guide works with JBC 3 as well. If you use the jboss-cache.jar from JBC 3 instead of the one from JBC 2, everything covered in the guide will work.

              Use of MVCC in the Hibernate use case essentially comes down to changing the node locking scheme config in your cache config from PESSIMISTIC to MVCC. Note however that there are some issues related to MVCC that are popping up; see some threads on this forum that have been active in the last week.

              Note that JBC 3 supports a different config format from the JBC 2 one. The stock configurations that ship with Hibernate use the old format, as does any discussion in the hibernate-jbosscache-guide. But JBC 3 can handle the old format just fine. And if you are creating a your own cache configuration and want to use the JBC 3 format that will work as well.

              • 4. Re: JBC 3.0 as L2 cache on other appservers than JBossAS
                nikant

                Thank you Brian.

                Your encouraging post and some RTFM did it (at least on Glassfish, WAS to come ...)! I still have some issues getting JBC to find my config file (hardcoded absolute path for the moment...) but it at least works.

                regards / Niklas