5

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.

Sam
  • 2,663
  • 10
  • 41
  • 60
Patrik
  • 1,286
  • 1
  • 31
  • 64
  • 1
    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? – Lieven Keersmaekers Jun 30 '11 at 12:36
  • 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. – Patrik Jun 30 '11 at 12:59
  • Thank you, I will try sysinternals tools and WinDbg. – Patrik Jun 30 '11 at 13:05
  • @Patrik - 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. – Lieven Keersmaekers Jun 30 '11 at 13:34
  • 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) – Cosmin Prund Jul 01 '11 at 06:20
  • 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 . – Patrik Jul 01 '11 at 07:20
  • 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. – Patrik Jul 01 '11 at 07:28

3 Answers3

1

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.

Good luck. See this help page for more info.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Evilripper
  • 1,165
  • 1
  • 15
  • 26
  • 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. – Patrik Aug 04 '11 at 06:53
  • Now seems the problem disapeared but I will wait with the celebration. I think the solution is not so simple. We will see. – Patrik Aug 04 '11 at 07:02
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.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41
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/?

Attila Szasz
  • 3,033
  • 3
  • 25
  • 39
  • 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. – Patrik Jul 12 '11 at 10:43