commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: [DBCP] DBCP-44 Deadlock
Date Sat, 21 Jul 2007 18:17:58 GMT
On Jul 20, 2007, at 5:26 PM, Phil Steitz wrote:

> On 7/20/07, Dain Sundstrom <dain@iq80.com> wrote:
>>
>> On Jul 20, 2007, at 11:26 AM, Dain Sundstrom wrote:
>>
>> > On Jul 19, 2007, at 11:19 PM, Phil Steitz wrote:
>> >
>> >> I would love to have a fix for DBCP-44; but that could wait on  
>> pool
>> >> 1.4 if necessary (and Ipersonally see no way to fix it just within
>> >> dbcp.  It would be great if I was wrong on that).
>> >
>> > I think the makeObject method is over synchronized.  Actually, the
>> > class doesn't look it's synchronized properly at all.  I'll take a
>> > shot at fixing this.
>>
>> I attached a patch that fixes the synchronization in
>> PoolableConnectionFactory, but the deadlock still persists.  The
>> problem is GenericObjectPool.borrowObject() is synchronized so when
>> it needs to makeObject that method is called while the synchronized
>> block is held.  I think this would take major surgery to make
>> GenericObjectPool not perform this way.
>
> Thats what I feared.  Thanks for looking in any case.
>>
>> I think the way to solve this is to write a new pool implementation
>> that is much more async.  This easier with the Java5 concurrent
>> packages, but still quite tricky.
>
> Yes, and at least for dbcp 1.3, I would prefer not to hop all the way
> to 1.5 required JDK level.

I agree.  I also wouldn't want to switch dbcp to a pool that hasn't  
been heavily tested first.

> I'll attempt to put together one
>> in a few days.  Regardless, I don't think this is something we should
>> target for this release.
>
> Before writing another one, have a look at the compositepool package
> in pool head.

Well, I got this email after hacking on one for about 6 hours.  I the  
kind of person that needs to finish things I start, so I'm going to  
keep hacking on it.  I will take a look at composite pool in 2.0 and  
assuming my version doesn't suck.  I'll see if I can merge any of my  
good features into that code.  In the end I may just end up wasting a  
lot of my time, but at least I'll learn how hard it is to write a  
good pool:)

-dain


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


Mime
View raw message