You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Foo Shyn <fo...@optegra.com.my> on 2006/09/14 09:01:25 UTC

Sharing Tomcat DBCP connection

Hi guys,

Currently i'm using Tomcat 4.1 and my application uses the Tomcat's DBCP to connect to a Derby database.

However, since the Derby database only allow one application to connect to it at a time, is it possible that i could configure the Tomcat's DBCP connection so that other application (not web application) can uses it as well?

Any ideas and hints are welcomed.

Thanx.
Regards,
FooShyn

Re: Sharing Tomcat DBCP connection

Posted by Stanley Bradbury <St...@gmail.com>.
Foo Shyn wrote:
> Hi guys,
>
> Currently i'm using Tomcat 4.1 and my application uses the Tomcat's DBCP to connect to a Derby database.
>
> However, since the Derby database only allow one application to connect to it at a time, is it possible that i could configure the Tomcat's DBCP connection so that other application (not web application) can uses it as well?
>
> Any ideas and hints are welcomed.
>
> Thanx.
> Regards,
> FooShyn
>   
Hi Foo Shyn -
This is a common misconception caused by all the cautions in the Derby 
documentation but, in your context, the warnings do not apply since you 
are working with a Client-Server architecture (Tomcat).  Derby is a 
multi threaded, multi user system that multiple deployed applications 
can safely use when it is embedded in a server architecture such as 
Tomcat. 

The key is to be sure that Derby is loaded by Tomcat in the same 
classloader as the DBCP classes (COMMON) then have all applications 
access Derby via DBCP datasources.  The Derby website has a paper that 
describes setting this up to run the JPetstore program.  The datasource 
created can be access by any program deployed to that server.  Here is 
the link to the Global Datasource setup instructions in the article: 

 http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html#Setup+of+Application+with+the+Datasource+in+the+Global+Context%3A

Hope this helps.



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Sharing Tomcat DBCP connection

Posted by Marc Farrow <ma...@gmail.com>.
Mikolaj''s response may seem a bit curt, but the point is that one
connection to a database is very limiting and not real practical.

On 9/14/06, Mikolaj Rydzewski <mi...@ceti.pl> wrote:
>
> Foo Shyn wrote:
> > Currently i'm using Tomcat 4.1 and my application uses the Tomcat's DBCP
> to connect to a Derby database.
> >
> > However, since the Derby database only allow one application to connect
> to it at a time, is it possible that i could configure the Tomcat's DBCP
> connection so that other application (not web application) can uses it as
> well?
> >
> > Any ideas and hints are welcomed.
> >
> Change the database?
>
> --
> Mikolaj Rydzewski <mi...@ceti.pl>
>
>
>
>


-- 
Marc Farrow

Re: Sharing Tomcat DBCP connection

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Foo Shyn wrote:
> Currently i'm using Tomcat 4.1 and my application uses the Tomcat's DBCP to connect to a Derby database.
>
> However, since the Derby database only allow one application to connect to it at a time, is it possible that i could configure the Tomcat's DBCP connection so that other application (not web application) can uses it as well?
>
> Any ideas and hints are welcomed.
>   
Change the database?

-- 
Mikolaj Rydzewski <mi...@ceti.pl>