2 Replies Latest reply on Nov 6, 2008 5:25 AM by daniel jarrett

    JBoss Cache

    Shafiur Rahman Mohammad Newbie

      In my project some of the requests take almost 4 minutes to respond and it appears that there are too many requests made to the database.
      Upon reading some articles, It said that a good practice to store the results of a request in a cache, instead getting them from database. I have heard about JBossCache, which does that exactly.

      How should I use JBOSSCache in my project? Do I have to change the whole code? or IS it just a tool which I can use along with the Jboss application server and get the functionality working? Whre should I use the feature on my project(in Coldfusion or Java)?

      Explanation:- I have .Net front end which call webservices written in Coldfusion. Coldfusion then calls the Java classe to get the transaction does? My java code has a lot of POJO's, stateless session bean?



        • 1. Re: JBoss Cache
          Sachin Parnami Newbie

          Hi,

          I think you can give it a try for your Data Base related problem.

          In my project some of the requests take almost 4 minutes to respond and it appears that there are too many requests made to the database.

          try to increase the pool size in server/xyz/deploy/xyz-ds.xml which would look like as :-

           <!-- The minimum connections in a pool/sub-pool. Pools are lazily constructed on first use -->
           <min-pool-size>5</min-pool-size>
          
           <!-- The maximum connections in a pool/sub-pool -->
           <max-pool-size>20</max-pool-size>
          

          Be sure that you are closing all the database connections properly.

          or check you have not commented the default connection closer by Jboss. :)

          Regards,
          Sachin Parnami

          • 2. Re: JBoss Cache
            daniel jarrett Newbie

            Hey there,

            I'm using the caching mechanism in jboss with persistent entities.

            If you have not already done so, it might be worth migrating your application to use ejb3's persistence. There are tools out there that will assist you with converting an existing db schema to ejb3/hibernate pojos. From here it is a matter of a few annotations and xml tags to utilize the L2 cache to stop your application making excessive duplicate sql queries.