[prev in list] [next in list] [prev in thread] [next in thread]
List: openejb-development
Subject: Re: Commons DBCP
From: Dain Sundstrom <dain () iq80 ! com>
Date: 2007-07-16 19:38:12
Message-ID: 50AFF170-F462-45A5-AB6E-6CE963C8F58E () iq80 ! com
[Download RAW message or body]
Committed. If you have any DB pooling problems let me know ASAP.
-dain
On Jul 12, 2007, at 10:38 AM, Dain Sundstrom wrote:
>
> On Jul 12, 2007, at 7:54 AM, Andrus Adamchik wrote:
>
>> From my experience DBCP works extremely well as a connection pool,
>> but the API can use some cleanup. My favorite example is
>> PoolableConnectionFactory [1]. So in Cayenne we have code like this:
>>
>> ObjectPool connectionPool = new GenericObjectPool(null, poolConfig);
>> new PoolableConnectionFactory(
>> factory,
>> connectionPool,
>> statementPool,
>> validationQuery,
>> defaultReadOnly ? Boolean.TRUE : Boolean.FALSE,
>> defaultAutoCommit,
>> defaultTransactionIsolation,
>> defaultCatalog,
>> null);
>> return connectionPool;
>>
>> PoolableConnectionFactory attaches itself to the connection pool
>> inside constructor. Looks weird - an object is created but not
>> assigned to anything. Every time I stumble upon this code, I have
>> to doublecheck that nothing insane is going on. 9-arg constructor
>> is also not good.
>>
>> Would be cool if new volunteers from Geronimo could refactor
>> things a bit ;-)
>
> I thought about that, but there is a lot of code and extensions to
> this so I don't think the API can be changed. I just created a new
> BasicManagedDataSource which uses JavaBeans properties to setup the
> data source. With the existing xbean-reflect code the data source
> "Just Works". I'm sure the same can be said for Spring.
>
> -dain
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic