Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle 8i (8.1.7): How to set timeout when connecting by OCI to remote DB

Re: Oracle 8i (8.1.7): How to set timeout when connecting by OCI to remote DB

From: Tomislav <shaka_at_envox.hr>
Date: Wed, 16 Jan 2002 11:57:29 +0100
Message-ID: <MRLN4539E6F62@merlin.envox.hr>


Yeah, but what about open network sockets, allocated memory space & stuff? How would I be sure that Oracle will release all of that?

This seems like quite a dirty way to go...

--
--
/Tomislav.

"Mladen Gogala" <mgogala_at_earthlink.net> wrote in message
news:pan.2002.01.15.21.40.51.614404.10075_at_earthlink.net...
On Tue, 15 Jan 2002 10:30:44 -0500, Tomislav wrote:


> I am wondering how can I set exact timeout how long I want to wait for a
> "OCIServerAttach" or "OCISessionBegin" functions to connect to a remote
> database.
>
> For example:
>
> - network is unplugged or unreachable: functions wait for a couple of
> seconds before reporting an error. I would like to specify exact time to
> wait for this event.
>
> Is the nonblocking mode the only way to go?
>
> --
> --
> /Tomislav.
The only way coming to mind is the posix "alarm" call. To remind you, "alarm" takes the number of seconds as the argument and upon the expiration sends SIGALRM to the invoking application. Application can then decide whether to ignore or act upon the signal (sigaction,signal). I don't know how to facilitate that on an NT machine, but on Unix it's a fairly simple task. More fashionable call with many more options is "setitimer" (set interval timer), which uses the same OS timer resource as the "alarm" call (and thus interferes with it, if both are used) but I strongly prefer the good, old "alarm" call because of it's simplicity. -- Mladen Gogala
Received on Wed Jan 16 2002 - 04:57:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US