commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wayne Woodfield <jaka...@woodfieldfamily.org>
Subject Re: [pool] negative numActive
Date Tue, 04 May 2004 16:38:01 GMT
You are correct.  To reduce overhead, GenericObjectPool doesn't keep track
of objects that are borrowed, only objects in the idle pool.  So if an item
is both returned and invalidated, or invalidated twice, GenericObjectPool
won't catch it.  So it becomes the responsibility of everyone using or
extending GenericObjectPool to prevent double-invalidation from happening.
Sounds like you've already figured that out though :-)  Good luck.

Lee Breisacher wrote:

> I'm using GenericObjectPool in my own app (not dbcp, not Tomcat). I am
> putting my own objects into the pool. I suspect what could be happening
> is that I am returning an (invalid) object more than once.   Hmm, I just
> looked at the returnObject code again, and I see now that returning an
> invalid object more than once can indeed make the numActive count go
> negative, BUT that's not a bug in GenericObjectPool - there's no way
> GenericObjectPool can know that an object has already been "destroyed".
>
> So, I'll have another look at my code!  Thanks for the response.
>
> Lee
>
>
>
> > -----Original Message-----
> > From: Wayne Woodfield [mailto:jakarta@woodfieldfamily.org]
> > Sent: Monday, May 03, 2004 11:16 PM
> > To: Jakarta Commons Developers List; Lee Breisacher
> > Subject: Re: [pool] negative numActive
> >
> > Even though AbandonedObjectPool extends GenericObjectPool,
> > the fix for one is probably not the fix for the other.  I've
> > debugged GenericObjectPool numActive problems a lot these
> > past few weeks, so if there are more, I'd be glad to help
> > find them.  In what context are you using GenericObjectPool?
> > Are you using GenericObjectPool with your own application?
> > With dbcp?  With Tomcat?  If Tomcat, what version of Tomcat?
> >
> > Wayne
> >
> > Lee Breisacher wrote:
> >
> > > I'm using GenericObjectPool and I'm seeing the "numActive" value go
> > > negative occasionally (and stay there). Looking at recent
> > commons-dev
> > > emails, I saw a similar discussion and patch applied to DBCP's
> > > AbandonedObjectPool.  It looks to me like the analysis and
> > patch for
> > > AbandonedObjectPool could correctly apply to the GenericObjectPool
> > > superclass. Yes?
> > >
> > > Thanks,
> > >
> > > Lee
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
> >


---------------------------------------------------------------------
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