REPOST: Database connection overload

2008-06-04 Thread Derek Hohls
Anyone have any ideas on this? On 2008/05/27 at 09:15, in message [EMAIL PROTECTED], Derek Hohls [EMAIL PROTECTED] wrote: Running Cocoon 2.1.8 It seems to be the case that, when the number of allowed database connections are exceeded (called by a getConnection in flowscript), the application

Re: REPOST: Database connection overload

2008-06-04 Thread Johannes Textor
Derek, the only condition I am aware of which might make the application freeze is when connections are not properly closed and returned to the connection pool. Could you post the javascript code you use to obtain a connection from the DB and then close it ? Regards, Johannes Derek Hohls

Re: REPOST: Database connection overload

2008-06-04 Thread Derek Hohls
Johannes This was my thought too. I have numerous modules functions that open (and should close!) connections. On manual inspection they all seem to be OK, but possibly there is one somewhere which is not correct. Hence my need to try and prevent this; or have the system in some way report

Re: REPOST: Database connection overload

2008-06-04 Thread Johannes Textor
Derek Hohls schrieb: Johannes This was my thought too. I have numerous modules functions that open (and should close!) connections. On manual inspection they all seem to be OK, but possibly there is one somewhere which is not correct. Hence my need to try and prevent this; or have the

Re: REPOST: Database connection overload

2008-06-04 Thread Derek Hohls
Johannes Thanks for the detailed insight into issues. I had hoped to avoid patching hundreds of functions. but I guess its inevitable. Would a function like the following be able to avoid the problem I have been having: function accessDB() { try { //get connection //do stuff...

Re: REPOST: Database connection overload

2008-06-04 Thread Johannes Textor
Derek, you should use the power of the finally construct, which is also available in JS: function accessDB() { try { //get connection //do stuff... //return result } catch(e) { cocoon.log.error (Unable to complete function accessDB); return null; } finally { //close

Re: REPOST: Database connection overload

2008-06-04 Thread Derek Hohls
Johannes OK - and I assume the } finally { //close connection } won't throw an error if the connection is *not* open? PS If there are any low entry barriers (i.e. not getting into Java, or having to rewrite everything for Hibernate...) to improving this approach, I would be very happy

Re: REPOST: Database connection overload

2008-06-04 Thread Johannes Textor
Derek Hohls schrieb: Johannes OK - and I assume the } finally { //close connection } won't throw an error if the connection is *not* open? It would throw an error in this case, but you could check if the connection is open before closing it. However, the error would not be