6 Replies Latest reply on Feb 22, 2006 8:17 AM by asafz

    clustered ejb3 entity beans replication

    asafz

      I'm new to ejb3,
      I'm trying to use the TreeCache for the second level cache.
      I used the same example as in the admin guide but I cannot see the treeCache being used at all.

      does some one have an persistence.xml example of a cluster deploy?

      does it supposed to access the treeCahce for every access of a clustered entity bean?

      thanx,

        • 1. Re: clustered ejb3 entity beans replication
          asafz

          I'm still dont knoe hoe to replicate the cache with clusterd ejb3 entity beans.

          its just look like the entitymanager is ignoring the treeCache and nothing is written to it although I used the same example as the 4.0.3 admin guide.

          does anyone know how to make it work?
          some can add a working persistence.xml file that make the cluster ejb3 entity bean work with the treeCache?


          thanx,

          • 2. Re: clustered ejb3 entity beans replication

            Couple of suggestions:

            1. Make your your machine is setup for clustering (i.e., multicast is working). You can check either the clsutering of jgroups wiki for this

            2. In jboss-4.0 src, under ejb3 modulem there is a unit test org.jboss.ejb3.test.clusteredentity/* that test this functionality.

            -Ben

            • 3. Re: clustered ejb3 entity beans replication
              asafz

              thanx ben,

              1. my cluster is working fine, I tested httpSession replication and slsb and sfsb load balancing and everything works fine.

              2. I looked at the unit test code where can I find the org.jboss.ejb3.test.clusteredentity.EntityTest implemetation class bean?
              (this is a session bean and I can only see the remote interface but i want to see the bean code to understand the testing)

              thnx,

              • 4. Re: clustered ejb3 entity beans replication

                Look for clusteredentity-test.jar in the build-test.xml and you should see.

                -Ben

                • 5. Re: clustered ejb3 entity beans replication
                  asafz

                  thanx ben,

                  my problem is solved.

                  the problem was that in my persistence.xml i used :

                  org.jboss.ejb3.entity.TreeCacheProviderHook


                  jboss.cache:service=EJB3EntityTreeCache


                  like the example in the admin guide but actually I should have used:

                  org.jboss.ejb3.entity.TreeCacheProviderHook


                  jboss.cache:service=EJB3EntityTreeCache


                  now its work fine,

                  • 6. Re: clustered ejb3 entity beans replication
                    asafz

                    sorry about this:
                    what i ment was that the property:
                    cache.provider_class
                    should be hibernate.cache.provider_class
                    and treecache.mbean.object_name should be hibernate.treecache.mbean.object_name

                    another question:
                    can I use the clustered treeCache for R/W or only for Read Only data?
                    what is the recommended way to use it?

                    thnx,