On 11.10.2012 14:43, Johan De Meersman wrote: > > ----- Original Message ----- >> From: "Markus Falb" <markus.f...@fasel.at> >> >> But why is retrying better than raising the value? >> >> So what is better, adjusting the timeout or retrying application side >> and why? > > Well, raising the timeout would probably help, but may cause more concurrent > connections to stay open until they block the server. > > The idea of retrying is that everything you've done before that particular > transaction has already been committed, so you (probably) can't easily undo > it. A retry gives you a chance to still finish what you were doing with no > other loss than some time waiting. Regardless of how many retries fail, you > will still be in the same position as you were when the first attempt failed.
With a low timeout the connection will be terminated sooner, but if the application retries another connection is taken. I could have raised the timeout with the same effect on the db side (1 process is waiting) but maybe more performant (no new connection necessary) and with simpler logic on the application side (no retry logic) Maybe you imply that there is some kind of sleep before the retry, so that other statements could be fulfilled? I still don't get it. -- Kind Regards, Markus Falb
signature.asc
Description: OpenPGP digital signature