Subject Re: [firebird-support] Keeping database connection permanently open
Author Nols Smit
Hi,

In my IntraWeb applications, I typically do the following upon destroying sessions:
IBDatabase1.CloseDataSets;
IBDatabase1.ForceClose;

My session timeout is configured as 60 minutes. It seems after the last session terminated, the database goes offline. Mustn't I perhaps reduce the 2-hour keepalive timeout of Windows to 60 minutes (my session timeout)?

I also open a database connection per session. I know this is not optimal and I must have only one connection per database per process and therefore I must use DataModule pooling and not to "IBDatabase1.ForceClose;"

The problem I have is the database (about 600 MB) take about 20 seconds to open after shut-down.
The mentioned database is the one under "What's new!" on www.tamaracka.com

By the way, can't the postings on this newsgroup be passed on to Tamarack Associates for indexing?

Regards,

Nols Smit


----- Original Message -----
From: Helen Borrie
To: firebird-support@yahoogroups.com
Sent: 16 November, 2006 11:31 AM
Subject: Re: [firebird-support] Keeping database connection permanently open


At 05:21 PM 16/11/2006, you wrote:
>Hi,
>
>I've some applications, written in Delphi 7 using the IntraWeb (&
>TMSIntraWeb) components and running as an Apache dll under Windows 2000.
>
>I notice after some time of no activity, the database shuts down.

If there are no users connected then the database is effectively in a
shut-down state because no users are connected. :-) As soon as the
next user connects, it won't be in a shut-down state any more.

>Is there a way to configure FireBird (and/or Apache) never to shut
>down, even if there are no active connections?

Erm, No. The database server keeps *listening* for connection
requests. The server won't be off-line unless YOU stop it. It's how
a *server* works.

>Or must I rather in the in the process (IntraWeb server controller)
>try to keep the database connection alive by occasionally access one
>record in a table?

No. Nothing of the sort.

>In the firebird.conf file, I noteced the following comments:
>
># Normally, Firebird uses SO_KEEPALIVE socket option to keep track of
># active connections. If you do not like default 2-hour keepalive timeout
># then adjust your server OS settings appropriately. On UNIX-like OS's,
># modify contents of /proc/sys/net/ipv4/tcp_keepalive_*. On Windows,
># follow instrutions of this article:
># http://support.microsoft.com/default.aspx?kbid=140325
>
>Is this something to look at?

No. It's something to look at when you are troubleshooting a problem
of users who go away and leave an open connection idle. On some
Windows configurations, that live connection will time out too soon
and it will be a further two hours (by default) before the Firebird
server knows about it.

>(I use the installation defaults of Apache and FireBird 1.5)

You don't seem to have a problem, as far as I can see. Perhaps you
need to provide some information about the problem you are encountering.

./heLen




Disclaimer Legal Notice:
By having opened and read this electronic mail, you are deemed to have understood and accepted all disclaimers and conditions pertaining to electronic mail emanating from, and received by The Council for Geoscience, further detail of which may be viewed by clicking here:
Disclaimer




Disclaimer Legal Notice:
By having opened and read this electronic mail, you are deemed to have
understood and accepted all disclaimers and conditions pertaining to
electronic mail emanating from, and received by The Council for Geoscience,
further detail of which may be viewed at the following hyperlink:
http://www.geoscience.org.za/disclaimer.htm




[Non-text portions of this message have been removed]