geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <>
Subject Re: Dynamically creating datasources
Date Mon, 26 Jun 2006 16:14:33 GMT

On Jun 26, 2006, at 5:24 AM, wrote:

> Why don't you dynamically programmatically create something like an
>  org.apache.commons.dbcp.BasicDataSource
> and then just cache the instance of that in a Map for use whenever  
> you need it. That way your code is app server indpendent.

That would be app server independent, but it would also preclude any  
container managed transaction features such as use of UserTransaction  
or CMT ejbs.  If you don't need any features like these this might  
well be your simplest solution.

There is no way to bind any such datasource into the java:comp jndi  
namespace and as the contents of this namespace are specified by the  
j2ee spec this is not likely to change.

Can you specify a bit more fully when the configuration info in the  
database is available, when it changes related to when the app is  
deployed/started/stopped, and how you want your program to get the  
reference to the datasources?

david jencks

> If you use  Spring for wiring up the datasources to whatever beans  
> that need them that will make life much easier as well.
> Target
> **********************************************************************
> This message is intended only for the use of the Addressee and may
> contain information that is PRIVILEGED and CONFIDENTIAL.
> If you are not the intended recipient you must not copy,
> distribute or take any action or reliance upon it.
> The content of this message may also contain personal
> views of an employee of this company and does
> not necessarily represent the view of the company.
> **********************************************************************
> This message has been scanned by Norton Anti-Virus.
> It has also been scanned by MAILsweeper to enforce our e-mail
> policy. If you have any concerns or comments about the content
> of this message, please e-mail
> **********************************************************************
> _____________________________________________________________________
> This email has been scanned for all viruses by the MessageLabs Email
> Security System. For more information on a proactive email security
> service working around the clock, around the globe, visit

View raw message