Monday, April 26, 2004  Data access sanity check  (Cross posted
from my blog)  One of the first tasks that I performed for my
employer was to diagnose and resolve a several minutes long CPU
spike on the database server for one of our J2EE applications.
All of our servers were well monitored, and without much ado we
were able to pin the spike on a specific use case. As it turns
out, the culprit was a use case for exporting Loan Application
records from our company to a client. To accomplish this task
several thousand Entity Beans were instantiated, data was
extracted from the objects, and a comma-delimited output file
was generated. Adding insult to injury, in addition to
instantiating thousands of EJBs, the collection exceeded our
cache size resulting in the passivation and activation of beans
(to and from the database) as we traversed the collection.  In
retrospect it's hard to fathom how this implementation strategy
got past a design review, but in the heat of battle all sorts of
less-then-optimal solutions