8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 17:23:03 +01:00

Execute ON DISCONNECT triggers in the following cases:

1. During database shutdown (gfix -shut full -force 0).
2. An attachment is deleted from MON$ATTACHMENTS by another attachment.
3. An attachment is closed by idle timeout.

ON DISCONNECT triggers will still not be executed during server shutdown.
This commit is contained in:
Ilya Eremin 2022-03-16 10:44:12 +03:00 committed by Alexander Peshkov
parent 446d4fa392
commit d64868cdcd

View File

@ -3313,15 +3313,15 @@ void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree
unsigned flags = PURGE_LINGER;
if (engineShutdown ||
if (engineShutdown)
flags |= PURGE_FORCE;
if (forceFree ||
(dbb->dbb_ast_flags & DBB_shutdown) ||
(attachment->att_flags & ATT_shutdown))
{
flags |= PURGE_FORCE;
}
if (forceFree)
flags |= PURGE_NOCHECK;
}
ISC_STATUS reason = 0;
if (!forceFree)
@ -8603,7 +8603,7 @@ namespace
{
// purge attachment, rollback any open transactions
attachment->att_use_count++;
purge_attachment(tdbb, sAtt, PURGE_FORCE);
purge_attachment(tdbb, sAtt, engineShutdown ? PURGE_FORCE : PURGE_NOCHECK);
}
catch (const Exception& ex)
{