Hello,

On Tue, Aug 7, 2012 at 9:36 PM, Martin Gainty <mgai...@hotmail.com> wrote:

>
> Germán
>
> Is there a reason why you would not use
> org.apache.commons.dbcp.datasources.SharedPoolDataSource from DBCP 1.4
> http://commons.apache.org/dbcp/apidocs/index.html

?


For what I've looked in the javadoc of that class, it serves a somewhat
different use case. In my concrete use case, the usename and password would
be the same, the main property I would want to change is the maxActive
connections. I want to have a new data source, which is independent of the
other, son I can potentially close one without affecting the other.

Also, at this moment I'm not evaluating to change the connection pooling
library.

Regards,
Germán


> Martin
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
> > From: german.ferr...@gmail.com
> > Date: Tue, 7 Aug 2012 20:06:53 -0300
> > Subject: tomcat-jdbc: correct way to create a new separated
> org.apache.tomcat.jdbc.pool.DataSource from another one
> > To: users@tomcat.apache.org
> >
> > Hello.
> >
> > I have an use case in which I would want to copy an
> > `org.apache.tomcat.jdbc.pool.DataSource`, to have two disjoint connection
> > pools, with some pool properties changed.
> >
> > My first thought was to do something like this:
> >
> > PoolProperties props = new
> > PoolProperties(baseDataSource.getPoolProperties());
> > // set custom props ...
> > DataSource newDataSource = new DataSource(props);
> >
> >
> > The problem is that the PoolProperties class doesn't have such
> constructor.
> > Another option could be to share the PoolProperties object, but, for what
> > I've looked into the code, it doesn't seem safe.
> >
> > The PoolProperties class implements the Cloneable interface, so I guess
> > it's ok to use its clone method. The problem I have with this option is
> > that DataSource#getPoolProperties() returns a PoolConfiguration which
> > doesn't implements Cloneable. In my case I think it would be safe to cast
> > the PoolConfiguration to PoolProperties, but it doesn't seem safe for the
> > general case.
> >
> > What would be the correct way to create a new separated DataSource from
> > another one having some properties changed?
> >
> > I'm using tomcat-jdbc 7.0.29 as a standalone library.
> >
> > Thank you.
> >
> > Regards,
> > Germán
>
>

Reply via email to