Subject | Re: FB 2.1 - new DB trigger feature with MON$ tables |
---|---|
Author | Paul R. Gardner |
Post date | 2008-04-09T18:19:27Z |
Dmitry Yemanov wrote:
IBExpert, as well as my application which is a Delphi application using
the FIBPlus components.
Thomas Steinmaurer wrote:
Good point, I hadn't thought of that. Actually, for testing, I did the
same thing for COMMIT as follows:
CREATE TRIGGER DATALOGGER
ACTIVE ON TRANSACTION COMMIT POSITION 0
AS
BEGIN
INSERT INTO GOODSQL(SQLTIME, SQLCMD)
SELECT CURRENT_TIMESTAMP, M.MON$SQL_TEXT
FROM MON$STATEMENTS M
WHERE M.MON$TRANSACTION_ID = CURRENT_TRANSACTION;
END
This never inserts anything either. When I view the MON$STATEMENTS
table before my application commits or does a rollback, I can see the
SQL in question. The TRANSACTION_ID field is always null. It's null
for all statements listed EXCEPT the one that IBExpert generated to view
that table (select * from MON$STATEMENTS).
[Non-text portions of this message have been removed]
> Are you sure your connectivity layer doesn't release all statementI don't believe that to be the case. I've tried transactions in
> handles when you issue a rollback?
IBExpert, as well as my application which is a Delphi application using
the FIBPlus components.
Thomas Steinmaurer wrote:
> The ON TRANSACTION ROLLBACK trigger feature is ready for prime timewhen
> Firebird supports autonomous transactions in PSQL, because if aROLLBACK
> happens, the INSERT INTO statement in the trigger gets rollbacked aswell.
Good point, I hadn't thought of that. Actually, for testing, I did the
same thing for COMMIT as follows:
CREATE TRIGGER DATALOGGER
ACTIVE ON TRANSACTION COMMIT POSITION 0
AS
BEGIN
INSERT INTO GOODSQL(SQLTIME, SQLCMD)
SELECT CURRENT_TIMESTAMP, M.MON$SQL_TEXT
FROM MON$STATEMENTS M
WHERE M.MON$TRANSACTION_ID = CURRENT_TRANSACTION;
END
This never inserts anything either. When I view the MON$STATEMENTS
table before my application commits or does a rollback, I can see the
SQL in question. The TRANSACTION_ID field is always null. It's null
for all statements listed EXCEPT the one that IBExpert generated to view
that table (select * from MON$STATEMENTS).
[Non-text portions of this message have been removed]