Hi Folks

I'm working on an old legacy app and noticed something.  It caches a bunch of 
info (lookup table data) from the database using a ServletContextListener.  I 
think opening DB connections in a listener is reasonable.  While there is no 
business logic in the listener, I'm not sure doing a bunch of DB heavy-lifting 
operations in a context listener is a "good thing", although I don't really 
have a concrete reason why.  Perhaps I'm just being fussy.

Anyway, in your opinion:

  1.  Is performing DB heavy-lifting operations in ServletContextListener a 
"reasonable" practice?
  2.  Is there a "better" way of caching said items at application startup?

Thanks for your time and consideration.  :-)

--
Cris Berneburg
CACI Senior Software Engineer


________________________________

This electronic message contains information from CACI International Inc or 
subsidiary companies, which may be company sensitive, proprietary, privileged 
or otherwise protected from disclosure. The information is intended to be used 
solely by the recipient(s) named above. If you are not an intended recipient, 
be aware that any review, disclosure, copying, distribution or use of this 
transmission or its contents is prohibited. If you have received this 
transmission in error, please notify the sender immediately.

Reply via email to