Please do not misunderstand me, it is not a recomendation,
it will not help too, but you can test this workaround at home:

1. before to return from "getConnection" pool sets "currentThread" for
connection.
2. if  !connection.getOwner().isAlive(), it safe to reuse connection.

It must be safe to return the same connection for the same thread for the
most of use cases too.
It can help to hide problem and to crashe later, but it is not *common* way
to solve problems .

----- Original Message -----
From: "Hope, Matthew" <[EMAIL PROTECTED]>
To: "'Jakarta Commons Developers List'" <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 4:16 PM
Subject: RE: [DBCP] AbandonedTrace - Connection Recovery


>
> > -----Original Message-----
> > From: Glenn Nielsen [mailto:[EMAIL PROTECTED]
> > Sent: 23 July 2003 13:52
> > To: Jakarta Commons Developers List
> > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery
> >
> >
> > Hope, Matthew wrote:
> > > I would disagree on one point. The idea of logging when a
> > connection is
> > > closed due to garbage collection finalization strikes me as
> > a good one
> > > (assuming the pool used is using a weakly referenced
> > mapping otherwise
> > > garbage collection release of resources is going to be a
> > real bummer).
> > >
> >
> > Using GC to log or recover an abandoned connection won't work
> > because the
> > connection is a member of the pool and will never be eligible for GC.
> >
> > Glenn
>
> I feel you may have missed my comment above to the effect that the pool is
> using a weakly referenced map.
>
> In those circumstances garbage collection would free resources. I would
> think that their use is sensible so long as the pool can handle their
> garbage collection and get another one (though that may have the knock on
> effect of causing the getting of the connection to be synchronized to the
> client request - not a huge big deal in most cases but in a well managed
> resource environment such weak references would be unnecessary.
>
> for an explanation see:
> http://java.sun.com/j2se/1.4.1/docs/api/java/lang/ref/WeakReference.html
>
> Matt
>
> **************************************************************************
> The information transmitted herewith is sensitive information intended
only
> for use by the individual or entity to which it is addressed. If the
reader
> of this message is not the intended recipient, you are hereby notified
that
> any review, retransmission, dissemination, distribution, copying or other
> use of, or taking of any action in reliance upon this information is
> strictly prohibited. If you have received this communication in error,
> please contact the sender and delete the material from your computer.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to