Caching fundamentals Data that changes rarely (Web hosting ratings)

Caching fundamentals Data that changes rarely Noncritical data (for example, content-management data) Data that is local to the application and not shared Bad candidates for second-level caching are Data that is updated often Financial data Data that is shared with a legacy application These aren t the only rules we usually apply. Many applications have a number of classes with the following properties: A small number of instances Each instance referenced by many instances of another class or classes Instances that are rarely (or never) updated This kind of data is sometimes called reference data. Examples of reference data are ZIP codes, reference addresses, office locations, static text messages, and so on. Reference data is an excellent candidate for caching with a process or cluster scope, and any application that uses reference data heavily will benefit greatly if that data is cached. You allow the data to be refreshed when the cache timeout period expires. We shaped a picture of a dual layer caching system in the previous sections, with a unit of work-scoped first-level and an optional second-level process or clus ter scope cache. This is close to the Hibernate caching system. 13.3.2 The Hibernate cache architecture As we hinted earlier, Hibernate has a two-level cache architecture. The various elements of this system can be seen in figure 13.7: The first-level cache is the persistence context cache. A Hibernate Session lifespan corresponds to either a single request (usually implemented with one database transaction) or a conversation. This is a mandatory first-level cache that also guarantees the scope of object and database identity (the exception being the StatelessSession, which doesn t have a persistence context). The second-level cache in Hibernate is pluggable and may be scoped to the process or cluster. This is a cache of state (returned by value), not of actual
We recommend high quality webhost to host and run your jsp application: christian web host services.

Leave a Reply