Hi Roland,

in some cases we did this to log all transaction starts commits (see 
script below).

Set GenMonTransactions to value less 10000 will activate log function.

You can simply to change to log transaction commits or rollbacks as well.

And in application you can easy log transaction id that was requested.


Slavek

Create Table MON_Transactions  (
     tDateUTC TimeDateUTC NOT NULL,
     sys_NETWORK_PROTOCOL Varchar(255),
     sys_CLIENT_ADDRESS Varchar(255),
     sys_CURRENT_USER Varchar(255),
     sys_CURRENT_ROLE Varchar(255),
     sys_SESSION_ID Varchar(255),
     sys_TRANSACTION_ID Varchar(255),
     sys_ISOLATION_LEVEL Varchar(255),
     mon_REMOTE_PROCESS Varchar(255),
     data TMemo
);

CREATE TRIGGER TRGMON_TransactionStart ON TRANSACTION START
AS
   DECLARE i INTEGER;
   DECLARE transactionID INTEGER;
   DECLARE remoteProcess VARCHAR(255);
BEGIN
   IF (10000 <= GEN_ID(GenMonTransactions, 0)) THEN BEGIN
     EXIT;
   END
   i = GEN_ID(GenMonTransactions, 1);
   transactionID = RDB$GET_CONTEXT('SYSTEM', 'TRANSACTION_ID');

   SELECT FIRST 1 mon$remote_process
   FROM mon$transactions T
   JOIN mon$attachments A ON A.mon$attachment_id = T.mon$attachment_id
   WHERE T.mon$transaction_id = :transactionID
   INTO :remoteProcess;

   INSERT INTO MON_Transactions(
     sys_NETWORK_PROTOCOL,
     sys_CLIENT_ADDRESS,
     sys_CURRENT_USER,
     sys_CURRENT_ROLE,
     sys_SESSION_ID,
     sys_TRANSACTION_ID,
     sys_ISOLATION_LEVEL,
     mon_REMOTE_PROCESS
   ) VALUES(
     RDB$GET_CONTEXT('SYSTEM', 'NETWORK_PROTOCOL'),
     RDB$GET_CONTEXT('SYSTEM', 'CLIENT_ADDRESS'),
     RDB$GET_CONTEXT('SYSTEM', 'CURRENT_USER'),
     RDB$GET_CONTEXT('SYSTEM', 'CURRENT_ROLE'),
     RDB$GET_CONTEXT('SYSTEM', 'SESSION_ID'),
     :transactionID,
     RDB$GET_CONTEXT('SYSTEM', 'ISOLATION_LEVEL'),
     :remoteProcess
   );
END^

Ing. Slavomir Skopalik
Executive Head
Elekt Labs s.r.o.
Collection and evaluation of data from machines and laboratories
by means of system MASA (http://www.elektlabs.cz/m2demo)
-----------------------------------------------------------------
Address:
Elekt Labs s.r.o.
Chaloupky 158
783 72 Velky Tynec
Czech Republic
---------------------------------------------------------------
Mobile: +420 724 207 851
icq:199 118 333
skype:skopaliks
e-mail:skopa...@elektlabs.cz
http://www.elektlabs.cz

On 17.6.2016 13:22, Roland Turcan k...@rotursoft.sk [firebird-support] 
wrote:
> <<< 17.06.2016 13:20 - Dimitry Sibiryakov s...@ibphoenix.com 
> [firebird-support] "firebird-support@yahoogroups.com" >>>
> DSsicfs> 17.06.2016 13:17, Roland Turcan k...@rotursoft.sk [firebird-support] 
> wrote:
>>> I don't want to post this issue into DEVEL, because it is a support
>>> question, but where are the guys able to answer or at least to point
>>> us to some hints.
> DSsicfs>    Every time I saw this error, it was a bug in my
> DSsicfs> application. No exceptions so far.
>
> Dmitry,  thanks  for your reply, could you please tell me what was the
> problem in your case?
>
> PS: I have never had this issue with FB2.5 or older.
>




------------------------------------

------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/resources/documents/ 

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-dig...@yahoogroups.com 
    firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

  • [firebird-s... Roland Turcan k...@rotursoft.sk [firebird-support]
    • Re: [f... Roland Turcan k...@rotursoft.sk [firebird-support]
      • [f... Norbert Saint Georges n...@tetrasys.eu [firebird-support]
        • ... Roland Turcan k...@rotursoft.sk [firebird-support]
          • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
            • ... Roland Turcan k...@rotursoft.sk [firebird-support]
              • ... Dimitry Sibiryakov s...@ibphoenix.com [firebird-support]
              • ... Slavomir Skopalik skopa...@elektlabs.cz [firebird-support]
                • ... cr...@mnhn.fr [firebird-support]
    • [fireb... Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]

Reply via email to