Re: [DBCP] Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-24 Thread Juozas Baliuka
to implement, if we can not > > to detect leak to fire event. > > But sandbox is open for R&D. > > > > - Original Message - > > From: "Danny Angus" <[EMAIL PROTECTED]> > > To: "Jakarta Commons Developers List" <[EMAIL

RE: [DBCP] Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-24 Thread Danny Angus
ot;Danny Angus" <[EMAIL PROTECTED]> > To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> > Sent: Thursday, July 24, 2003 10:15 AM > Subject: [DBCP] Event/Listener proposal (was .. RE: [DBCP] > AbandonedTrace - > Connection Recovery) > > > >

Re: [DBCP] Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-24 Thread Juozas Baliuka
o detect leak to fire event. But sandbox is open for R&D. - Original Message - From: "Danny Angus" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Thursday, July 24, 2003 10:15 AM Subject: [DBCP] Event/Listener proposa

Re: [DBCP] Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-24 Thread David Graham
+1 on a listener model but let's not rule out using the Strategy pattern as well. They both may come in handy. David --- Danny Angus <[EMAIL PROTECTED]> wrote: > Well I never, > There's been a lot of talk generated by my innocent proposal of using > the > Observer pattern, or in more java-esque

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-24 Thread Hope, Matthew
> -Original Message- > From: Juozas Baliuka [mailto:[EMAIL PROTECTED] > Sent: 23 July 2003 12:52 > To: Jakarta Commons Developers List > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > Logging is useless in this case, Such a statement seems ludicrous...

[DBCP] Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-24 Thread Danny Angus
Well I never, There's been a lot of talk generated by my innocent proposal of using the Observer pattern, or in more java-esque terms events and listeners to arrive at a compromise in the Connection Recovery War. I'd like to clarify some points raised. In the first place to address the criticism o

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
#x27;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 1

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
#x27;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 1

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
ent: Wednesday, July 23, 2003 10:54 PM Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > Do not use broken code for production, but it must be possible to solve > > without broken pool. > > > What utopia do you live in? I think it would be a close approx

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread John McNally
> > Do not use broken code for production, but it must be possible to solve > without broken pool. > What utopia do you live in? I think it would be a close approximation to say that every piece of software in production use in the world today has bugs. And it is not a broken pool that allows t

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
- Original Message - From: "John McNally" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 23, 2003 8:54 PM Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > I get the impression that some of you believe connection cleanup is

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread John McNally
> > Using a weak reference for pooled connections which are in use is a good idea > and I am all for it. > > The only problem is that there is no guarantee when the weak referenced > db connection pool object will be GC'd. That is highly dependent upon > how the JVM implements GC. There is no g

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread John McNally
> I get the impression that some of you believe connection cleanup is > difficult. It really is trivial to properly dispose of connections in a > finally block. It is not always trivial. Yes, you can have some high level try/finally block to clean up resources, but you must make sure the code

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Noel J. Bergman
> That sounds like a better implementation as it is unlikely to timeout > long running transactions. But implementing an Observer pattern in > the Connection, Statement, ResultSet implementations would still allow > such an implementation, right? Let me please take advantage of this moment of san

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread John McNally
> > The current implementation recover's the abandoned connection based > on an inactivity timeout. So it has to track the last time the > connection was used. This more tightly couples it to DBCP. That sounds like a better implementation as it is unlikely to timeout long running transactions.

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Glenn Nielsen
David Graham wrote: Using a WeakHashMap might be a good solution. Connections are guaranteed to be closed when they are garbage collected so if a client doesn't return a connection and loses all pointers to it, the pool would lose its reference to it and the Connection would get gc'd. This is

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Hope, Matthew
speed... Matt > -Original Message- > From: David Graham [mailto:[EMAIL PROTECTED] > Sent: 23 July 2003 15:48 > To: Jakarta Commons Developers List > Subject: RE: [DBCP] AbandonedTrace - Connection Recovery > > > --- "Hope, Matthew" <[EMAIL PROTECTED]>

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread David Graham
> > Using a WeakHashMap might be a good solution. Connections are > guaranteed > > to be closed when they are garbage collected so if a client doesn't > return > > a connection and loses all pointers to it, the pool would lose its > > reference to it and the Connection would get gc'd. This is *mu

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Glenn Nielsen
Juozas Baliuka wrote: /** * Get a db connection from the pool. * * If removeAbandoned=true, recovers db connections which * have been idle > removeAbandonedTimeout. * * @return Object jdbc Connection */ As I remember we have decided to log stack trace, but not to

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
Is this code released as commons component ? - Original Message - From: "Glenn Nielsen" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Wednesday, July 23, 2003 2:56 PM Subject: Re: [DBCP] AbandonedTrace - Connection Recover

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
> What happens is that the broken app ends up sucking up resources for > each concurrent request being made to it which is waiting for the > db connection timeout. Usually this is set to 5-10 seconds. > This can suck up alot of resources. Memory, threads, etc. Web server with limited request/th

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Glenn Nielsen
John McNally wrote: [snip] On the implementation. I have not looked closely at the current implementation as it is not used by the pool that I added to dbcp and I was trying to start it as a simple implementation of the latest specification. But it would seem an implementation of this should ju

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Glenn Nielsen
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 bu

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Glenn Nielsen
David Graham wrote: --- "Laird J. Nelson" <[EMAIL PROTECTED]> wrote: -Original Message- From: John McNally [mailto:[EMAIL PROTECTED] Why is this such a contentious issue? FWIW, because some users have business experience, and some do not. Those who do recognize that business *runs* on stop

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
t; > > -Original Message- > > From: Juozas Baliuka [mailto:[EMAIL PROTECTED] > > Sent: 23 July 2003 11:34 > > To: Jakarta Commons Developers List > > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > > > > > > > You

Event/Listener proposal (was .. RE: [DBCP] AbandonedTrace - Connection Recovery)

2003-07-23 Thread Danny Angus
Well I never, There's been a lot of talk generated by my innocent proposal of using the Observer pattern, or in more java-esque terms events and listeners to arrive at a compromise in the Connection Recovery War. I'd like to clarify some points raised. In the first place to address the criticism o

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Hope, Matthew
e the constraints you have a problem. Matt > -Original Message- > From: Juozas Baliuka [mailto:[EMAIL PROTECTED] > Sent: 23 July 2003 11:34 > To: Jakarta Commons Developers List > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > &g

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
Jakarta Commons Developers List'" <[EMAIL PROTECTED]> Sent: Wednesday, July 23, 2003 10:50 AM Subject: RE: [DBCP] AbandonedTrace - Connection Recovery a viewpoint I can sympathise with but I don't see how that effects the use case I outlined below. This is not recovery,

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
You misunderstand me. http://www.springframework.org/ I have never used this framework, but I use the same ideas. > > I did a lot of this kind of bugs myself too and it is very > > trivial to fix. > > 1. Set maxConnections to 1 for testing > > useful > > > 2. Use lazy decorator for connection to

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Hope, Matthew
003 09:19 > To: Jakarta Commons Developers List > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > "Connection Recovery" can not help to solve resouce leak and > performance > problems, but It can produce more problems. > I can not let to brea

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Hope, Matthew
> I did a lot of this kind of bugs myself too and it is very > trivial to fix. > 1. Set maxConnections to 1 for testing useful > 2. Use lazy decorator for connection to throw exeption from "close" ??? > 3. Use "find/replace" to remove all "}finally{ connection.close(); }" ??!?!?!?! > 4. Store de

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-23 Thread Juozas Baliuka
ta Commons Developers List'" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 2:34 PM Subject: RE: [DBCP] AbandonedTrace - Connection Recovery 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

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
I did a lot of this kind of bugs myself too and it is very trivial to fix. 1. Set maxConnections to 1 for testing 2. Use lazy decorator for connection to throw exeption from "close" 3. Use "find/replace" to remove all "}finally{ connection.close(); }" 4. Store decorator in ThreadLocal and close co

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
> > This attitude is not very helpful. I don't see how dbcp supplying the > ability to configure a connection pool to reclaim connections is that > big of an issue. Have you tried to solve problems this way ? Is it tested solution and can be used for "high quality software" ? Try to implement an

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Serge Knystautas
Juozas Baliuka wrote: I like innovations, but try to implement and test it at home please. I am sure there are not so many situations in the real world need this "feature". It takes a few minutes to find connection leak and to fix it in any applications, doe's not it ? It does not. I have 2 new

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
I like innovations, but try to implement and test it at home please. I am sure there are not so many situations in the real world need this "feature". It takes a few minutes to find connection leak and to fix it in any applications, doe's not it ? > David Graham wrote: > > This is absolutely no

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Serge Knystautas
David Graham wrote: This is absolutely not a DBCP code issue; it is a management issue. Applications that leak resources should have their own separate connection pool. When they run out of connections, only that app will break and won't affect any other applications on the server. It will be mu

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread David Graham
--- "Laird J. Nelson" <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: John McNally [mailto:[EMAIL PROTECTED] > > Why is this such a contentious issue? > > FWIW, because some users have business experience, and some do not. > Those who do recognize that business *runs* on stopg

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Laird J. Nelson
> -Original Message- > From: John McNally [mailto:[EMAIL PROTECTED] > Why is this such a contentious issue? FWIW, because some users have business experience, and some do not. Those who do recognize that business *runs* on stopgap solutions. The fewer of those stopgap solutions you have t

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread John McNally
On Tue, 2003-07-22 at 10:28, Juozas Baliuka wrote: > > I agree that this is an education/policy issue. But sometimes you need > > a stop gap solution to keep something running while the customer fixes > > the problem. > > > > I would like to see this stop gap solution included with the DBCP releas

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread John McNally
On Tue, 2003-07-22 at 10:15, Juozas Baliuka wrote: > > http://java.sun.com/products/jdbc/jdbc2_0_1-stdext-javadoc/javax/sql/PooledC > onnection.html > > +1 to implement this interface, but I do not think it can help for broken > applications. > That is an interface to be implemented by a jdbc d

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
> I agree that this is an education/policy issue. But sometimes you need > a stop gap solution to keep something running while the customer fixes > the problem. > > I would like to see this stop gap solution included with the DBCP release. > Along with quality docs on how to properly use a db conn

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
mmons Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 5:38 PM Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > On Tue, 22 Jul 2003, Juozas Baliuka wrote: > > > Date: Tue, 22 Jul 2003 14:15:53 +0200 > > From: Juozas Baliuka <[EMAI

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Glenn Nielsen
David Graham wrote: --- Serge Knystautas <[EMAIL PROTECTED]> wrote: David Graham wrote: IMO, a design that allows users to plugin behaviors, be they connection retrieval or otherwise, is the best solution. Then the question becomes whether to include a connection retrieval behavior in the DBCP

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread adam kramer
o: Jakarta Commons Developers List <[EMAIL PROTECTED]> > > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > > > I do not think it is good idea to maintain any kind of public API for > > "abandoned connections", It is garbage, > > If ap

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Craig R. McClanahan
On Tue, 22 Jul 2003, Juozas Baliuka wrote: > Date: Tue, 22 Jul 2003 14:15:53 +0200 > From: Juozas Baliuka <[EMAIL PROTECTED]> > Reply-To: Jakarta Commons Developers List <[EMAIL PROTECTED]> > To: Jakarta Commons Developers List <[EMAIL PROTECTED]> > S

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread David Graham
--- Serge Knystautas <[EMAIL PROTECTED]> wrote: > David Graham wrote: > > IMO, a design that allows users to plugin behaviors, be they > connection > > retrieval or otherwise, is the best solution. Then the question > becomes > > whether to include a connection retrieval behavior in the DBCP > rel

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
- Original Message - From: "Danny Angus" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 3:18 PM Subject: RE: [DBCP] AbandonedTrace - Connection Recovery > Juozas, > > > I think I will

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Serge Knystautas
David Graham wrote: IMO, a design that allows users to plugin behaviors, be they connection retrieval or otherwise, is the best solution. Then the question becomes whether to include a connection retrieval behavior in the DBCP release. I think that's far outside the scope of DBCP and encourages u

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread David Graham
--- Danny Angus <[EMAIL PROTECTED]> wrote: > Juozas, > > > I think I will leave commons and I will spend more my time on SF > > with forked > > code, if this kind of vote can win at apache. > > My input is not a very big, but I will lose any energy to work for > crap . > > I think it is sad that

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Danny Angus
Juozas, > I think I will leave commons and I will spend more my time on SF > with forked > code, if this kind of vote can win at apache. > My input is not a very big, but I will lose any energy to work for crap . I think it is sad that you would rather leave than suggest any alternative. It hig

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Rob Leland
Danny Angus wrote: Serge et al, Further to my suggestion about using the Observer pattern for event notification w.r.t. point 4 (below) I forgot to mention that it also has the benefit of offering a compromise in the pro/anti recovery debate. Existing contentious code designed to reclaim or test

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
- Original Message - From: "Danny Angus" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Tuesday, July 22, 2003 2:19 PM Subject: RE: [DBCP] AbandonedTrace - Connection Recovery > Juozas, > > > I do not t

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Hope, Matthew
22 July 2003 13:16 > To: Jakarta Commons Developers List > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > I do not think it is good idea to maintain any kind of public API for > "abandoned connections", It is garbage, > If application or server i

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Danny Angus
Juozas, > I do not think it is good idea to maintain any kind of public API for > "abandoned connections", It is garbage, > If application or server is not broken, it doe's not need workarounds. It is easy for you to say this, but the fact remains that a number of people are quite vocal in their

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Juozas Baliuka
I do not think it is good idea to maintain any kind of public API for "abandoned connections", It is garbage, If application or server is not broken, it doe's not need workarounds. Workarounds can not help for broken applications any way, it is a useless stuff and it infects code with "Observers".

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Danny Angus
Serge et al, Further to my suggestion about using the Observer pattern for event notification w.r.t. point 4 (below) I forgot to mention that it also has the benefit of offering a compromise in the pro/anti recovery debate. Existing contentious code designed to reclaim or test connections need no

RE: [DBCP] AbandonedTrace - Connection Recovery

2003-07-22 Thread Danny Angus
Serge, > 1. Remove existing abandoned recovery attempt code. > 2. Log when connections are abandoned and do not add them back into the > pool. > 3. Optionally log stack trace of where abandoned connection was first > grabbed. > 4. Provide some kind of extensible connection object that could allow

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread Phil Steitz
a Commons Developers List" <[EMAIL PROTECTED]> > Sent: Monday, July 21, 2003 4:51 PM > Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > > > > David Graham wrote: > > >>I fess up, I am the guilty party who added the ability to trace > > >

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread Glenn Nielsen
David Graham wrote: That is not a good reason IMHO to prevent those who feel it is a very important feature from including a sub class which supports this with the DBCP release. The fact that DBCP cannot reliably determine whether a connection has been abandoned is a very good reason to not inc

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread David Graham
> > So, what are these more effective ways to prevent pages? > > Not deploying code with resource leaks, training developers on proper > resource cleanup, calling developers responsible for the resource leak > in > the middle of the night to help you fix the problem, etc. I forgot one: If apps

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread David Graham
> > I strongly disagree. You getting paged due to someone's poor coding > > abilities is outside the scope of DBCP. There are much more effective > > ways of preventing pages than by developing a library that covers up > > coding mistakes so that they persist indefinitely. > > > > So, what are

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread Juozas Baliuka
t; <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Monday, July 21, 2003 4:51 PM Subject: Re: [DBCP] AbandonedTrace - Connection Recovery > David Graham wrote: > >>I fess up, I am the guilty party who added the ability to trace &g

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-21 Thread Glenn Nielsen
David Graham wrote: I fess up, I am the guilty party who added the ability to trace abandoned connections and recover them. ;-) Sorry to jump in late on this. I have been busy with other things. The motivation behind this was to allow a servlet container to continue operating normally even if you

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-20 Thread David Graham
> I fess up, I am the guilty party who added the ability to trace > abandoned > connections and recover them. ;-) > > Sorry to jump in late on this. I have been busy with other things. > > The motivation behind this was to allow a servlet container to continue > operating normally even if you ha

Re: [DBCP] AbandonedTrace - Connection Recovery

2003-07-20 Thread Glenn Nielsen
Noel J. Bergman wrote: It appears clear that there are two camps, each with fairly strong views. Personally, I believe that both camps can be accomodated in a way that should satisfy both. DBCP should focus on core pooling behavior related to connections and prepared statements, and leave policy is