Thomas Darimont wrote:
The jar is made available to both the applications:
WebApplication1 - WEB-INF/lib/dbconnection.jar
WebApplication2 - WEB-INF/lib/dbconnection.jar

Tomcat is started:
WebApplication1 servlet init() is called , which inturn makes a call to the
Initialise turbine
WebApplication2 servlet init() is called , which inturn makes a call to the
Initialise turbine(again!!!!)

Now, When a connection is made to the DB by WebApplication1 , it will get a
connection from the connection pool created by WebApplication1 and When a connection is made to the DB by WebApplication2 , it will get a
connection from the connection pool created by WebApplication2

Problem:
Since both the applications are connecting to the same DB, I would like to
have both the applications served with connections from the same pool.

How can I implement this in the scenario presented above?

P.S : The Struts factor in the above problem is that both my web
applications are struts based :))

What about removing the dbconnection.jar from the WEB-INF/lib and putting it 
into the %TOMCAT_HOME%/common/lib directory ?
There it will be found from both WebApps using the same classloader... static 
Blocks will then only be executed once (IMHO).

Kind regards,
Thomas

Alternatively, you could configure a datasource in Tomcat and have both web apps look it up, instead of having each app setup its own database connections.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to