>>> XJ:_Micael_K�llman <[EMAIL PROTECTED]> 9/7/99 11:45:59 PM >>>
> At the moment I am doing getAttribute() twice
You need to do this to ensure that the ConnectionPool has not been instantiated...
but you probably don't need to do it unless you're going to load multiple copies of
the servlet (since init() should only be called once).
There is nothing wrong with it though (some servlet engines call init() many times for
some reason) and it doesn't really cost you much since servlet start up time is not
usually a factor one worries about.
>but since I really should synchronize the calls for getAttribute()
Aren't they synchronized already by the engine? But perhaps you're right.
If you use a class variable you _will_ have to sync.
Using attributes is fine but is generally only done when you want to share data across
multiple servkets.
My personal recommendation is to use a class variable, either static or instantiated
within init().
Nic Ferrier
Tapsell-Ferrier Limited
http://www.tapsellferrier.co.uk
"Use Ockham Luke"
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html