So want your DAO's to be singletons? You would have to make them Thread-safe (or synchronize and kill performance), beware that database connections are not thread-safe.
Please note that i'm using using the database connection pooling facilities provided by the Servlet Container (Apache Tomcat). As long as the DAO aquires the database connection through a JNDI datasource, the Servlet Container will take care of the thread and connection management issues.
The preferred method is use a DI facility (like Guice or Spring) and instantiate a new DAO each time and inject the database connection into it and inject the DAO into the Struts action.
I'd prefer to avoid the use of additional libraries for the time being which is why I haven't taken advantage of the libraries that you mentioned.
I'm more than happy to remove the acquiring of the datasource code from the DAO's constructor, and add a method to allow an instantiated version of the class to be assigned a data source. However, I would need a way of acquiring the datasource and assigning it to the DAO *without* using any additional libraries.
Any ideas? Thanks for the response. Jazz --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org