You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Pawan Singh <pa...@pinger.org> on 2010/01/18 06:18:20 UTC

[DBCP] Shutting down Derby and the Pool

Hi

I am using Apache Derby (embedded) and Apache DBCP to set up a nice pooling data source. My question is how to close this pooling data source properly when the application shuts down. If I am not using DBCP, I can make direct JDBC calls on the Derby data source to shutdown the database - but I cannot figure out how to do this when the data source is DBCP Pooled DataSource.

The examples on the DBCP project page do not do any shutdown of the data source at all.

-Pawan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [DBCP] Shutting down Derby and the Pool

Posted by Phil Steitz <ph...@gmail.com>.
Pawan Singh wrote:
> I am using PoolingDataSource. This data source does not seem to have a way of shutting down.
> 

Assuming you are using a o.a.c.pool.impl.GenericObjectPool as the
backing pool, you can hold onto a reference to the pool and call the
close method of the pool.

Phil

> -Pawan
> 
> On Jan 18, 2010, at 9:44 AM, Phil Steitz wrote:
> 
>> Pawan Singh wrote:
>>> Hi
>>>
>>> I am using Apache Derby (embedded) and Apache DBCP to set up a nice pooling data source. My question is how to close this pooling data source properly when the application shuts down. If I am not using DBCP, I can make direct JDBC calls on the Derby data source to shutdown the database - but I cannot figure out how to do this when the data source is DBCP Pooled DataSource.
>>>
>>> The examples on the DBCP project page do not do any shutdown of the data source at all.
>> Which DBCP datasource are you using?  If it is BasicDataSource, you
>> can use the close() method.
>>
>> Phil
>>
>>
>>> -Pawan
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>>> For additional commands, e-mail: dev-help@commons.apache.org
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [DBCP] Shutting down Derby and the Pool

Posted by Pawan Singh <pa...@pinger.org>.
I am using PoolingDataSource. This data source does not seem to have a way of shutting down.

-Pawan

On Jan 18, 2010, at 9:44 AM, Phil Steitz wrote:

> Pawan Singh wrote:
>> Hi
>> 
>> I am using Apache Derby (embedded) and Apache DBCP to set up a nice pooling data source. My question is how to close this pooling data source properly when the application shuts down. If I am not using DBCP, I can make direct JDBC calls on the Derby data source to shutdown the database - but I cannot figure out how to do this when the data source is DBCP Pooled DataSource.
>> 
>> The examples on the DBCP project page do not do any shutdown of the data source at all.
> 
> Which DBCP datasource are you using?  If it is BasicDataSource, you
> can use the close() method.
> 
> Phil
> 
> 
>> 
>> -Pawan
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
>> For additional commands, e-mail: dev-help@commons.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Re: [DBCP] Shutting down Derby and the Pool

Posted by Phil Steitz <ph...@gmail.com>.
Pawan Singh wrote:
> Hi
> 
> I am using Apache Derby (embedded) and Apache DBCP to set up a nice pooling data source. My question is how to close this pooling data source properly when the application shuts down. If I am not using DBCP, I can make direct JDBC calls on the Derby data source to shutdown the database - but I cannot figure out how to do this when the data source is DBCP Pooled DataSource.
> 
> The examples on the DBCP project page do not do any shutdown of the data source at all.

Which DBCP datasource are you using?  If it is BasicDataSource, you
can use the close() method.

Phil


> 
> -Pawan
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org