Java Reference
In-Depth Information
the database each time would needlessly waste database and network resources. One of the
tricks to scalability is caching this frequently accessed data.
Figure 3.11. Action Bazaar's featured item is a good candidate for a singleton session bean.
Each of these different clients gets the same spotlighted item from a singleton bean. The
singleton bean caches the value on startup and then updates the value at midnight. The fol-
lowing listing contains the code for this bean. Not shown is the SystemInitializer
bean that configures logging and performs other startup operations; it's included in the zip
file containing the chapter's source code.
 
Search WWH ::




Custom Search