Subject | Re: [firebird-support] MON$STATEMENTS - IBO vs IBexpert |
---|---|
Author | Dmitry Yemanov |
Post date | 2009-04-24T06:04:51Z |
tomjanczkadao wrote:
upon the first reference and cached until the transaction ends. So the
information will never be updated between trigger calls inside the same
transaction. Things get especially unpredictable if some other code
could also query the monitoring tables in the same transaction...
Dmitry
>This approach is wrong by design. The monitoring snapshots are created
> CREATE OR ALTER TRIGGER MY_TABLE_BD0 FOR MY_TABLE
> ACTIVE BEFORE DELETE POSITION 0
> AS
> declare variable temp_sql varchar(10000);
> begin
> /* there can be more than one active stmt */
> for select longc(STMT.MON$SQL_TEXT)
> from MON$STATEMENTS STMT
> where STMT.MON$ATTACHMENT_ID = current_connection
> and STMT.MON$STATE = 1
upon the first reference and cached until the transaction ends. So the
information will never be updated between trigger calls inside the same
transaction. Things get especially unpredictable if some other code
could also query the monitoring tables in the same transaction...
Dmitry