> From: CBy [mailto:tom...@byrman.demon.nl] > Subject: Re: [OT] Question on Executor (thread pool) > > I thought it was pretty common to share precious resources across web > apps. Isn't database connection pooling often implemented this way?
Not in my experience - you want to keep things as separate as possible for ease of operation and maintenance. You can use a single DB connection pool across webapps, but unless the webapps are fairly tightly coupled beyond using a common database, I wouldn't. > If mine isn't, what then would be a good use case for using the shared > class loader? A few things come to mind: 1) Tomcat manages the resource of interest, so the classes have to be available to Tomcat code. 2) The webapps require a singleton (or equivalent static fields) on a global server basis. (I would try to avoid this situation.) 3) A native library is being used, and since native code can only be loaded once per JVM, the Java classes have to be in shared. The servlet spec is pretty clear about webapps being independent; coupling them ends up forcing administrators to take the server up and down rather than individual webapps. It also makes upgrading one webapp at a time a difficult if not impossible task. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________