Re: [cx-oracle-users] Time out parameter for connect?
Brought to you by:
atuining
From: Paul M. <p.f...@gm...> - 2005-10-25 19:46:24
|
On 10/25/05, Anthony Tuininga <ant...@gm...> wrote: > I don't believe there is any method in the OCI that allows you to > specify this value. Googling certainly suggests as much (others have > asked for this capability and been told that it does not exist). Note > that SQL*Net does allow you to specify such things so perhaps you need > to look at the SQL*Net configuration. I have certainly wanted this and never found a suitable way of managing it. You can do the connect in a thread, and wait for the thread to complete for a set time. If the connection hasn't been made by then, you can do whatever you want on a timeout (report an error, whatever). But if you then want to end your program, you'll need to wait for the thread - if you don't (for example, by making the thread a daemon) I've found you can get odd crashes or other errors (I never worked out why, or managed to put together a useful test case - I just marked it down as "don't do that"). I'm not quite sure how you configure SQL*Net to time out after a given period. I remember looking, but I don't recall finding any suitable parameter. Paul. |