4 Replies Latest reply on May 11, 2004 6:31 PM by ben.wang

    Use of JBoss's cache with hibernate

      Does anyone know how to configure the new cache system to work with Hibernate?
      One Hibernate's website it says it can integrate with JBoss Cache.
      Anyone seem examples?

      And if it is possible, is it possible to use JBoss's cache in an MBean on 3.2.2?

      Thanks for any help

        • 1.

          Hi,

          1. Hibernate2.1 will have a final release including JBossCache integration. Watch out for the release announcement sometime this week (or the next) :-)

          Usage for it should be transparent in the sense that you will only need to configure the cache option in hibernate.properties. Then all the configuration is done through the jbosscache.xml (or some name like that).

          2. We are in the process to backport cache to 3.2 right now. As a matter of fact, the source code is in there already. So it should be done soon. And yes, it will be a MBean service. What is your intended usage, just curious?

          Cheers,

          -Ben

          • 2.

            The usage willl be for core tables of a crisis / 911 RMS type of system.
            Basically, caching small lookup tables for improved performance.

            I am not to sure how detailed an explantion you wanted.

            We use JBoss in linux cluster so it runs clustered over 3 machines.
            I have low change lookup tables that are high select.
            So I am looking at caching.
            We went with just session beans for the applicaton. and hand coded SQL.
            Ugly but tad faster than EJB -- in 2.4.4 days.
            Now after playing with Hibernate i love it but desire the caching 2 and if i could start off using JBoss cache I figure thats for the better because i eventually will be using it.

            After implementing JBos cache with Hibernate I also want to make "cluster only caches".
            I have tables that i join to determine what sessions need what resources as the resources change.
            If the cache thing works out. I will add custimzed cache to track the session info on a resource by resource basis so i dont need to keep hiting db for this.

            I know if hibernate + cache works i wont be hitting the db.
            But if i have a "cached" table for each resource I am sure i can cut some time off the binding that hibernate would have to do and as the application constantly does these lookups, I should free up resources and improve performance.

            I'll test it and find out.

            Anyway thanks for quick response.

            • 3. Re: Use of JBoss's cache with hibernate
              yangju

              We are using Jboss 3.2.3 and hibernate 2.1.3. We are trying to use latest jbosscache 1.0 to work with hibernate. But hibernate needs a config file named as "treecache.xml". Without this, it will complain when jboss starts. We really want to see this treecache running as a mbean so that we can change its arritbutes at runtime. But I don't see it from jmx-console. Based on the discussion above, it seems that I need to have some-service.xml to start treecache as a mbean? But hibernate requires "treecache.xml".

              What should I do? Do I have to use jboss 3.2.4 instead of 3.2.3 to see the mbean?

              Thanks.

              • 4. Re: Use of JBoss's cache with hibernate

                You can't use TreeCache as a mbean service inside Hibernate. That's the current integration limitation from Hibernate.

                Thanks,

                -Ben