You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Chen, Dean (Zhun)" <De...@gs.com> on 2002/06/17 17:36:00 UTC

Where to store datasource

Hi,
I have a simple design question. I use JDBC naming to acquire connections to
my Sybase database. To obtain a connection, it references a datasource. The
question is where should I store the datasource reference?
Should I
A. store datasource in session scope and everytime a query is needed the app
will obtain a connection via the datasource?
B. create the datasource everytime a new connection is needed?

Would I need to create some sort of factory to hold the datasources?

Thanks

Dean

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Where to store datasource

Posted by James Mitchell <jm...@telocity.com>.
I would choose C



C. Use connection pooling such as Poolman

<JMHO/>

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org

> -----Original Message-----
> From: Chen, Dean (Zhun) [mailto:Dean.Chen@gs.com]
> Sent: Monday, June 17, 2002 11:36 AM
> To: 'Struts Users Mailing List'
> Subject: Where to store datasource
> 
> 
> Hi,
> I have a simple design question. I use JDBC naming to acquire 
> connections to
> my Sybase database. To obtain a connection, it references a 
> datasource. The
> question is where should I store the datasource reference?
> Should I
> A. store datasource in session scope and everytime a query is 
> needed the app
> will obtain a connection via the datasource?
> B. create the datasource everytime a new connection is needed?
> 
> Would I need to create some sort of factory to hold the datasources?
> 
> Thanks
> 
> Dean
> 
> --
> To unsubscribe, e-mail:   
> <ma...@jakarta.apache.org>
> For additional commands, e-mail: 
> <ma...@jakarta.apache.org>
> 
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>