You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Gary Gregory <ga...@gmail.com> on 2018/08/17 17:05:23 UTC

[DBCP] Abandoned trace should use CopyOnWriteArrayList instead of custom sync

Hi All and Phil:

In [DBCP] Abandoned trace we use an Array with synchronized blocks. Should
we replace this usage with a CopyOnWriteArrayList and no custom blocks?

Gary

Re: [DBCP] Abandoned trace should use CopyOnWriteArrayList instead of custom sync

Posted by Gary Gregory <ga...@gmail.com>.
org.apache.commons.dbcp2.AbandonedTrace.getTrace() is a protected method
which folks might be calling from custom subclasses. So if we did change
the internal representation we might have to do a conversion to support
this method.

Gary

On Fri, Aug 17, 2018 at 11:13 AM Gary Gregory <ga...@gmail.com>
wrote:

> A  CopyOnWriteArrayList won't work since it does not support remove()...
> but the idea is to replace the ArrayList with a java.utl.concurrent
> structure...
> Gary
>
> On Fri, Aug 17, 2018 at 11:05 AM Gary Gregory <ga...@gmail.com>
> wrote:
>
>> Hi All and Phil:
>>
>> In [DBCP] Abandoned trace we use an Array with synchronized blocks.
>> Should we replace this usage with a CopyOnWriteArrayList and no custom
>> blocks?
>>
>> Gary
>>
>

Re: [DBCP] Abandoned trace should use CopyOnWriteArrayList instead of custom sync

Posted by Phil Steitz <ph...@gmail.com>.
On 8/17/18 10:13 AM, Gary Gregory wrote:
> A  CopyOnWriteArrayList won't work since it does not support remove()...
> but the idea is to replace the ArrayList with a java.utl.concurrent
> structure...

Interesting idea.  The thing to check is how method activations 
depend on the locks.  A quick look indicates that there is a mix of 
"lock for snapshot" and "lock for integrity."  j.u.concurrent things 
tend to work nicely for the second but not for the first.

Phil
> Gary
>
> On Fri, Aug 17, 2018 at 11:05 AM Gary Gregory <ga...@gmail.com>
> wrote:
>
>> Hi All and Phil:
>>
>> In [DBCP] Abandoned trace we use an Array with synchronized blocks. Should
>> we replace this usage with a CopyOnWriteArrayList and no custom blocks?
>>
>> Gary
>>


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


Re: [DBCP] Abandoned trace should use CopyOnWriteArrayList instead of custom sync

Posted by Gary Gregory <ga...@gmail.com>.
A  CopyOnWriteArrayList won't work since it does not support remove()...
but the idea is to replace the ArrayList with a java.utl.concurrent
structure...
Gary

On Fri, Aug 17, 2018 at 11:05 AM Gary Gregory <ga...@gmail.com>
wrote:

> Hi All and Phil:
>
> In [DBCP] Abandoned trace we use an Array with synchronized blocks. Should
> we replace this usage with a CopyOnWriteArrayList and no custom blocks?
>
> Gary
>