9 Replies Latest reply on Aug 8, 2008 7:22 AM by manik

    JBoss Cache and Weblogic 10

    leonid.brandis

      Hi

      I have a question about integrating the JBossCache with Weblogic 10.
      Did anybody have any experience/recommendations about this.
      Where can I get the most updated documentation on that topic?

      Thanks you

        • 1. Re: JBoss Cache and Weblogic 10
          manik

          What do you mean by integrating? if you want to use JBC from a webapp or an ear, that should be pretty straightforward, just make sure (if you are using it in a clustered mode) that you don't use the same multicast address and port as the one WL uses.

          • 2. Re: JBoss Cache and Weblogic 10
            leonid.brandis

            My application is using standalone Java GUI in the client and POJOs behind a session facade on Weblogic 10. The application polls the database every 10sec and passes some java data objects back to cllient. When the number of logins to database goes after 30 the perf degrades significantly. I'm looking for solution to improve the perf. I though that JBossCache could be used to cache some most often used objects.
            By integrating I mean to have Weblogic startup and shutdown classes to start and stop the cache, how to register is with JMX server in weblogic.

            Do you think it is the right tool for what I need?
            Do you mean that I could use it just like any java lib?
            How does it refresh itself? Should I develop the code? Can you point me to any examples?

            Thanks a lot for your help.

            • 3. Re: JBoss Cache and Weblogic 10
              leonid.brandis

              I found the website but the zip does not have the startup file examples.

              Is it a valid document?


              http://wiki.jboss.org/wiki/JBossCacheAndWebLogic

              • 4. Re: JBoss Cache and Weblogic 10
                manik

                Hmm, no idea why the startup class is missing. But it is simple to write one. I've added a section at the end of that wiki with links on how to write an appropriate startup and shutdown class.

                • 5. Re: JBoss Cache and Weblogic 10

                   

                  "leonid.brandis" wrote:
                  I found the website but the zip does not have the startup file examples.

                  Is it a valid document?


                  http://wiki.jboss.org/wiki/JBossCacheAndWebLogic


                  Hi,

                  I have recently integrated JBossCache in Weblogic. I am initializing my pojocache object in the SecurityContextListner. I have not faced any problems till now. Each server in a cluster will have it's own copy. Replication/invalidation all taken care by the JBoss-Caching framework.


                  • 6. Re: JBoss Cache and Weblogic 10
                    leonid.brandis

                    Thanks a lot for your help.

                    Is there a way to setup jbosscacache to catch the changes in the database and update a cached object?

                    I posted a brief description of my app architechture in previous posts. What I'm looking for is to minimize calls to database by using cache. It turns out that to update the cached object I need to make a call to the database to get changes first and the update the object. This way I do not get any improvement

                    • 7. Re: JBoss Cache and Weblogic 10

                      I dont think you can have link between your database and pojocache. Any updates to database it's application's responisiblity to update/invalidate the cache.

                      In my application, whenever the data is updated in the database the same data is invalidated in the cache. I dont update it. So, when there is request for the same data, it will get it from DB and stores in cache.

                      When a node (data) is invalidated in server. the corresponding node( data) is also invalidated in the other servers of the cluster. There is no need of updating data since it will be updated in the next request.

                      My sequence of DB call is something like this.
                      ///////////////////////////////////////////////////
                      Object obj = getFromCache(fqn);
                      if(obj != null)
                      return obj;
                      obj = getFromDB();

                      putInCache(fqn, obj);
                      return obj;
                      ///////////////////////////////////////////////////


                      IF data is updated
                      //////////////////////////////////////////////////
                      updateDB(obj);
                      invalidateInCache(fqn);
                      ///////////////////////////////////////////////////

                      • 8. Re: JBoss Cache and Weblogic 10
                        jason.greene

                        If you guys are using hibernate, another option is to use the second-level cache. which can be configured to use jboss cache as the cache engine. Then it does the hard work of maintaining the cache for you.

                        • 9. Re: JBoss Cache and Weblogic 10
                          manik

                          And if you are NOT using Hibernate, looking at how Hibernate interfaces with JBoss Cache will help you achieve something similar. You should look at how their code interacts with their Cache interface, which is then (optionally) backed by JBoss Cache.