struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <>
Subject [OT] Re: Using websphere datasource in Struts
Date Tue, 22 Aug 2006 15:12:06 GMT
Shyamsunder Reddy ha scritto:
> What is the best place to call Websphere DataSource in Struts application.

Eheh, it's not so simple :-)

> Instantiate it when ActionServlet is loaded and then pass onto Model classes as reference


>  OR create a static class that instantiates the DataSource and getConnections from this
class which should be Singleton

Do not use singleton in web application, because it raises several 
problem during reloading the webapp.

Instead, you could use a container-managed datasource to call through JNDI:

Or use Spring or a similar IoC container to configure your Model (this 
is what I prefer to do):


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message