3) In my servlet init(), I lookup the data-source. Each lookup essentially
instantiates an instance of the data-source. So a connection pool gets
instantiated in each servlet's init.
Now it doesn't make sense to create a new connection pool in each servlet.
So I'd like to create a single connection pool that will be used by all
servlets. I've been looking thru the tomcat docs, to see where I could
create this central resource for my webapp. The only option I've seen so far
is to create my own life-cycle listener for my webapp. That way I can create
a connection pool on start-up. I was wondering if there was a better way to
do this ?
It's actually your container which create the connection pool and not
your servlet. What you do when you are looking up is just finding a
reference to the pre-existing datasource. So don't worry and please do
not write your own lifecycle :-)
Regards, Ali.
----------------------------------------------------
Ce message a ete envoye par le serveur IMP de l'EMA.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]