There is no way in the OCI that I am aware of for dealing with timeouts.
There may be something available in SQL*Net (sqlnet.ora) that would deal
with this -- in fact I am fairly certain there is but never having used
it I wouldn't know for certain. A quick scan of the sample sqlnet.ora
that ships with Oracle 9i shows a value sqlnet.inbound_connect_timeout
which may do what you want. The only other option (that I can think of)
is to use threads or processes and a timer to implement your own timeout
of some sort -- not a very palatable option, though. :-)
On Wed, 2004-03-17 at 11:30, Paul Moore wrote:
> Is it possible to force a timeout on a cx_Oracle.connect? I have a job
> which connects to a number of databases, but occasionally one of the
> connections hangs. I'm not sure why, it may be a network problem or
> something, but I can't find a way of stopping it.
>
> To avoid the whole job hanging, I'd like to be able to specify a
> timeout on the connection attempt. I've checked the cx_Oracle
> documentation, and what I can of the Oracle documentation (I know very
> little of how OCI works) but I can't see a way of doing this.
>
> Is it possible?
>
> Thanks,
> Paul.
--
Anthony Tuininga
an...@co...
Computronix
Distinctive Software. Real People.
Suite 200, 10216 - 124 Street NW
Edmonton, AB, Canada T5N 4A3
Phone: (780) 454-3700
Fax: (780) 454-3838
http://www.computronix.com
|