You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Dave Oxley <da...@daveoxley.co.uk> on 2003/10/20 19:54:54 UTC

[DBCP] Bug with Poolable PreparedStatements and DriverAdapterCPDS

When setting up my pool like this:
            DriverAdapterCPDS cpds = new DriverAdapterCPDS();

            cpds.setDriver(jdbc_driver_name);
            cpds.setUrl(url);
            cpds.setUser(user);
            cpds.setPassword(pwd);
            cpds.setPoolPreparedStatements(true);

            SharedPoolDataSource tds = new SharedPoolDataSource();
            tds.setConnectionPoolDataSource(cpds);
            tds.setMaxActive(50);
            tds.setMaxWait(-1);
            tds.setMaxIdle(10);
            tds.setDefaultAutoCommit(false);

I get the following exception when calling prepareStatement(sql):

Caused by: java.lang.RuntimeException: java.lang.ClassCastException
    at 
org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.makeObject(PooledConnectionImpl.java:324)
    at 
org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:792)
    at 
org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.prepareStatement(PooledConnectionImpl.java:243)
    at 
org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.prepareStatement(ConnectionImpl.java:332)

Dave.


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


Re: [DBCP] Bug with Poolable PreparedStatements and DriverAdapterCPDS

Posted by Dirk Verbeeck <di...@pandora.be>.
Dave,

I have made a buzilla entry to track this problem.
http://issues.apache.org/bugzilla/show_bug.cgi?id=24136

-- Dirk

Dirk Verbeeck wrote:
> Looks like there is a bug in prepared statement pooling of 
> DriverAdapterCPDS.
> You can report this issue in bugzilla against v1.1.
> 
> Sort term solution:
> Disable the statement pooling, cpds.setPoolPreparedStatements(false)
> or switch to BasicDataSource (statement pooling included in v1.1)
> 
> But this bug should be fixed of couse.
> 
> Regards
> Dirk
> 
> Dave Oxley wrote:
> 
>> When setting up my pool like this:
>>            DriverAdapterCPDS cpds = new DriverAdapterCPDS();
>>
>>            cpds.setDriver(jdbc_driver_name);
>>            cpds.setUrl(url);
>>            cpds.setUser(user);
>>            cpds.setPassword(pwd);
>>            cpds.setPoolPreparedStatements(true);
>>
>>            SharedPoolDataSource tds = new SharedPoolDataSource();
>>            tds.setConnectionPoolDataSource(cpds);
>>            tds.setMaxActive(50);
>>            tds.setMaxWait(-1);
>>            tds.setMaxIdle(10);
>>            tds.setDefaultAutoCommit(false);
>>
>> I get the following exception when calling prepareStatement(sql):
>>
>> Caused by: java.lang.RuntimeException: java.lang.ClassCastException
>>    at 
>> org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.makeObject(PooledConnectionImpl.java:324) 
>>
>>    at 
>> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:792) 
>>
>>    at 
>> org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.prepareStatement(PooledConnectionImpl.java:243) 
>>
>>    at 
>> org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.prepareStatement(ConnectionImpl.java:332) 
>>
>>
>> Dave.



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


Re: [DBCP] Bug with Poolable PreparedStatements and DriverAdapterCPDS

Posted by Dirk Verbeeck <di...@pandora.be>.
Noel J. Bergman wrote:

>>Looks like there is a bug in prepared statement pooling of
> 
> DriverAdapterCPDS.
> 
>>You can report this issue in bugzilla against v1.1.
> 
> Does this mean we'll be having a 1.1.1 soon?  I saw another bug reported
> this AM regarding maxActive=0.

That one was closed as invalid by the reporter himself.
But there is another bug reported in InstanceKeyDataSourceFactory.

A 1.1.1 release with bugfixes is possible of course.

Dirk




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


RE: [DBCP] Bug with Poolable PreparedStatements and DriverAdapterCPDS

Posted by "Noel J. Bergman" <no...@devtech.com>.
> Looks like there is a bug in prepared statement pooling of
DriverAdapterCPDS.
> You can report this issue in bugzilla against v1.1.

Does this mean we'll be having a 1.1.1 soon?  I saw another bug reported
this AM regarding maxActive=0.

	--- Noel


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


Re: [DBCP] Bug with Poolable PreparedStatements and DriverAdapterCPDS

Posted by Dirk Verbeeck <di...@pandora.be>.
Looks like there is a bug in prepared statement pooling of DriverAdapterCPDS.
You can report this issue in bugzilla against v1.1.

Sort term solution:
Disable the statement pooling, cpds.setPoolPreparedStatements(false)
or switch to BasicDataSource (statement pooling included in v1.1)

But this bug should be fixed of couse.

Regards
Dirk

Dave Oxley wrote:

> When setting up my pool like this:
>            DriverAdapterCPDS cpds = new DriverAdapterCPDS();
> 
>            cpds.setDriver(jdbc_driver_name);
>            cpds.setUrl(url);
>            cpds.setUser(user);
>            cpds.setPassword(pwd);
>            cpds.setPoolPreparedStatements(true);
> 
>            SharedPoolDataSource tds = new SharedPoolDataSource();
>            tds.setConnectionPoolDataSource(cpds);
>            tds.setMaxActive(50);
>            tds.setMaxWait(-1);
>            tds.setMaxIdle(10);
>            tds.setDefaultAutoCommit(false);
> 
> I get the following exception when calling prepareStatement(sql):
> 
> Caused by: java.lang.RuntimeException: java.lang.ClassCastException
>    at 
> org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.makeObject(PooledConnectionImpl.java:324) 
> 
>    at 
> org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:792) 
> 
>    at 
> org.apache.commons.dbcp.cpdsadapter.PooledConnectionImpl.prepareStatement(PooledConnectionImpl.java:243) 
> 
>    at 
> org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.prepareStatement(ConnectionImpl.java:332) 
> 
> 
> Dave.
> 



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