Blocked queries on any change in AOT

You may face a blocking issue on SQL Server each time you do any change in AOT. And you’re using database log. This is the problem. While using database log an insert trigger on SysDatabaseLog table is always dropped and recreated what is causing blocking issues on SysDatabaseLog table. There are 2 options how to solve this issue:

1. Do not use database log

2. Modify createDateTimeTrigMSSQLOnTable method in SysSQLinitDBTriggers class as follows:

 ...
     // Drop trigger if it exists
     if (resultSet.next() && (resultSet.getString(1) == '1'))
     {
// ADDED - This should avoid dropping and recreating trigger for SysDatabaseLog table
         if (tableName == 'SYSDATABASELOG')
         {
             return;
         }
  
        // ADDED - This should avoid dropping and recreating trigger for SysDatabaseLog table - END

        sqls = 'DROP TRIGGER ' + dbSchema + "." + triggerName;
        ssep2 = new SqlStatementExecutePermission ( sqls );
        ssep2.assert(); 



        //BP Deviation Documented
        statement.executeUpdate(sqls);
        CodeAccessPermission::revertAssert();
     }
…

Martin F

Comments