My Delphi 7 with Firebird 1.5.6 application is freezing itself after some time of inactivity on Windows 7
Asked Answered
T

3

6

I have developed a Delphi 7 application that is using Firebird 1.5.6 database in client server environment.

The application is running on Windows 7 32 bit on notebook computer an the database is running on Windows XP 32-bit machine that is used as a server. The problem is the application is freezing itself when it is left idle for some time. This problem never occured on Windows XP only when we installed it on Windows 7.

Everything was working fine for 5 years but now on Windows 7 the application is totaly unstable.

Sometimes the wake up time is 10-30 sec with success but sometimes never with messages "application not responding" or "application crashes".

I have no idea where to search or what to try to find a solution. I tried to make a timer with 10 secconds resolution to make it constantly active but with no success.

BTW I am running in Administrator mode with XP Compatibility mode active. I have not tried the virtual XP Mode yet but I think it will not solve the problem.

Totem answered 30/6, 2011 at 12:19 Comment(7)
Do you keep connections active? Are they still active? Have you tried looking at sysinternals process explorer's stack view for your frozen process? Have you tried attaching a debugger? Have you tried sysinternals procmon? As a last resort, have you tried WinDbg?Shame
Yes I do. My Connections are active all the time at least while the application is still doing some work. When my application freezes I saw in the Firebird log that the server deiconnected but reconnects automatically. The funny part of the story this problem appears only on my client's working environment. I have never succeded to replicate such condition. On my testing environment everything is ok. I think some strange OS config parameter is making a problem disconnecting the app. after inactivity or maybe something like an antivirusis the cause of the problem.Tried but unsuccessfully.Totem
Thank you, I will try sysinternals tools and WinDbg.Totem
@Totem - Not an easy problem to fix. Should you find it, I would be very interested to know what it was and how you finally tracked it down.Shame
Are you connecting using the local protocol? If so try connecting using IP (you can use 127.0.0.1 to connect to the local machine)Deianira
I am connecting to a remote computer so I am must use a connection string something like 192.168.0.100:C:\DB\database.db .Totem
Personally I think the problem is in way Windows XP and Windows 7 are managing connections when there is no traffic. Somewhere I read that there is a parameter in registry that manages that timout and disconnection.Totem
S
2

I had a similar problem: on some standalone machines (firebird server and client on same PC) with Windows 7 32-bit, there were sometimes freeze of application (Delphi 7).

All freezes had the same time (60 seconds). I tried to change firebird.conf and after some tests I found the parameter DUMMY_PACKET_INTERVAL.

I set it to a very low value and the freezes seem to have disappeared.
Certainly there are problems with your connection that remains open.
Control firebird.log and try to test yourself.

Soothsay answered 3/8, 2011 at 12:0 Comment(2)
Thank you for your information. I will try it but I have no explanation why the default parameters worked without problems on Win Xp - Win Xp combination and not on Win Xp - Win 7.Totem
Now seems the problem disapeared but I will wait with the celebration. I think the solution is not so simple. We will see.Totem
P
0

Could it be that the database file's extension is .gdb and windows is XP is backing up the file as described here http://www.firebirdfaq.org/faq353/?

Pesky answered 11/7, 2011 at 8:4 Comment(1)
Thank you very much for your answer but no. I know about that issue so every Firebird database I create and manage has the .fdb extension.Totem
W
0

If you never did solve it, I think its to do with transactions. You said that the connections were active all the time. I would guess that you are using automatic/auto-commit transactions. When you do this the transaction of interest never moves because the transaction is always retained (commit and retain).

When this happens, firebird can not clean up the garbage without running the garbage collection process. This causes two issues.

  1. Queries keep on slowing down as firebird has to trawl through more and more versions of the data.

  2. Then firebird reaches a difference in transaction count reaches the default of 20000, it performs garbage collection slowing down everything massively.

The solution is to not use autocommit transaction. And if your daily transaction count is high then set the firebird count to a higher value and do the garbage collection yourself at a more suitable time.

Womanish answered 31/7, 2015 at 5:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.