How to kill Firebird (2.1) attachment/connection if VPN was used for database session

543 Views Asked by At

I am using VPN (Endpoint Security, Check Point) to establish connection to the Firebird 2.1 database from IBExpert on my computer. Sometimes I just forget disconnect from database and I cancel/disonnect VPN session only.

When I am connectiong once more to the VPN and database I can see in the mon$attachments that the previous connection/attachment is still existing and its unresolved transactions are causing deadlock errors (that belong to the previous attachment - this can be verified exactly by the transaction number that is reported in the error message of deadlock error).

So - VPN sometimes retains sessions and those VPN sessions keeps the Firebird attachments in existences.

Is there way how can I (using SYSDBA connection) end those other Firebird attachments from my current Firebird session?

I have contacted the VPN administrator to cancel VPN sessions, but it takes time. Database shutdown is out of the question - DB is in production mode. So, ending Firebird attachments using SQL is the only option left for me - if such option exists at all?

1

There are 1 best solutions below

0
On BEST ANSWER

In Firebird 2.5 and later, you can delete a connection from MON$ATTACHMENTS to kill a connection. This is not supported with the monitoring tables in Firebird 2.1 as far as I'm aware.

Given even Firebird 2.5 is end-of-life, and Firebird 2.1 has been end-of-life since 2014, you should really consider updating.

Normally, Firebird uses the SO_KEEPALIVE socket option to detect dead connections, but this can take a long time (depending on your OS configuration). An alternative might be to configure dummy_packet_interval in firebird.conf to a non-zero value (the value is seconds, so set it to a reasonable (read, not too low) value).