Posts: 17
Threads: 8
Joined: Mar 2020
Reputation:
0
Location: Canada
07-20-2021, 03:14 PM
(This post was last modified: 07-20-2021, 04:04 PM by StephanM.)
I just migrated an ISAPI app to a new server.
On this new Win 2019 Server, if I leave that app idle for more than 10 minutes, when I get back to it and click a button I get:
Error details:
Exception message : invalid transaction handle (expecting explicit transaction start)
Depending on the error condition, it might be possible to restart the application.
Exception class : TDBXError
Any ideas?
C++Builder 10.3 Update 3
IntraWeb 15.2.3
I've checked that TIWServerController::SessionTimeout = 30 ;
On the IIS App Pool, Idle Timeout = 35
The same app does not have this problem on the previous server; but I don't know if that means it's a server setting.
Thanks for your input.
Posts: 2,261
Threads: 196
Joined: Mar 2018
Reputation:
86
Location: Auckland, New Zealand
I think your DB connection handle is somehow being invalidated. Something is closing your connection and it is probably IIS. Is it a new DB server?
Posts: 17
Threads: 8
Joined: Mar 2020
Reputation:
0
Location: Canada
Yes, it's a new dedicated Firebird DB server as well. We moved from a single/multi-purpose server to 3 Amazon Workspace servers.
I don't know how to stop IIS from closing the DB connection. I don't think it's the DB server closing it, since our Windows program connecting to that DB has no issues.
Posts: 2,261
Threads: 196
Joined: Mar 2018
Reputation:
86
Location: Auckland, New Zealand
07-24-2021, 02:18 AM
(This post was last modified: 07-24-2021, 02:18 AM by Alexandre Machado.)
The first thing you need to check is the Idle timeout setting of your application pool.
Open IIS console, go to Application Pools. Select the application pool that your app is using and click on Advanced Settings.
There is an option named Idle Time-out (minutes). Adjust this setting to be more than your application timeout.
Also, check another option named Regular Time Interval under Recycling. It also needs to be high enough (the default is more than adequate, though).
In case you change anything, also restart IIS. See if it changes anything
Posts: 17
Threads: 8
Joined: Mar 2020
Reputation:
0
Location: Canada
Thanks for your suggestion Alexandre.
Those settings were correct.
TIWServerController:
SessionTimeout = 30 ;
App Pool:
Limit Interval = 35
Idle Time-out = 35
Failure Interval = 10
Recycling, Regular Interval = 1440 (was 1740)
But it's not the application that stops running, only its DB connection that is lost.
I don't think it's a problem with the code since the same exe does not have this issue on the old server.
And I'm not aware of a Firebird DB server having a connection timeout.
Any ideas of what to check next?
I'll report back if I find anything on my end.