2 Replies Latest reply on Dec 11, 2002 6:03 PM by hunterhillegas

    CMP Commit Option A Cache Question


      I have an application that uses CMP Entities in Commit Option A. I am testing it on JBoss 3.2 beta 2.

      The app uses session facades and servlet+JSP to display the data.

      I have a JSP page that displays a list of hotels. It includes a servlet that calls a SLSB to do a findAll() on the Hotel entity. The SLSB returns value objects that represent the entities.

      I have my database logging turned all the way up so I can see what queries are executing.

      The first time I run this, I see a query that loads all of the entities. This is to be expected.

      The thing is, I see this on subsequent requests as well. Shouldn't this all be in the CMP cache since I am using option A? Why would it be going back to the database?

      Trying to figure out if we have a design problem with our application.


        • 1. Re: CMP Commit Option A Cache Question


          JBoss does not have an in memory query engine, so all queries must go directly to the database. The only exception is findByPrimary key, which first checks if the bean is live in the cache.

          Bill Burke sent me an example of a query results cache that caches query results for commit option A until an entity is modified in the query domain. Then the cache is flushed. I haven't looked at the code yet, but I plan on integrateing it as an option in 4.0.

          • 2. Re: CMP Commit Option A Cache Question

            Thanks for the response...

            4.0 is sounding more and more sweet every day...