Re: Does Oracle connection timeout and disconnect?

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: 2000/04/22
Message-ID: <956415153.29283.0.pluto.d4ee154e_at_news.demon.nl>#1/1


Robert Foo <robertfoo_at_pacific.net.sg> schreef in berichtnieuws 8dsa5r$6js$1_at_newton3.pacific.net.sg...
> Hi all,
>
> I have a multi threaded (8 threads) application that uses
 Microsoft
> ODBC to communicate with Oracle 8. Each thread will connect to the Oracle,
> and each thread serves a client. Each time b4 a query is made, it checks
> 'Select 'X' from dual' to make sure that connection exists, if not, it
 will
> try to reconnect. The application runs fine after starting for a while.
> However, if I try to use the application the next day. The application
 will
> crash, even if I have only 1 client connecting to the application. I am
> wondering if the Oracle will time out the connection if there is
 inactivity
> for extended period of time, and terminate the connection? Does it? If
 not,
> how does it handles if there are app servers that 'hang' and still owning
 a
> connection? If many of these servers are repeatedly created and then
 hanged,
> would not there by many connections left hanging around?
>
> Hope someone could enlightened me.
>
> Regards
>
> Robert
>
>

depends on how Oracle is configured and whether the server is rebooted outside office hours.
If you do nothing, connections will be 'alive' indefinitely. If the connection doesn't log off properly it is considered a session by Oracle. You could set an idle time in the users profile. If you do that the session will be killed after a certain amount of time. However, the user will only notice this when he starts doing something again. You could also set an expire time in your server sqlnet.ora file. If the expire_time is non-zero, sqlnet will poll every n minutes to see whether the session is still active, if not the session will be killed, marked as snuped and after a while being cleaned.
The default behavior is sessions have no idle time, and the expire_time is 0. This means everything will stay alive indefinitely. However, if the server or the database is rebooted, all sessions will be terminated. Oracle will not however re-establish contact with sessions which have been disconnected.

Hth,

Sybrand Bakker, Oracle DBA Received on Sat Apr 22 2000 - 00:00:00 CEST

Original text of this message