System i5 details for the Transaction user name (tranusername) Method - Connect_CDC - connect_cdc_mimix_share - Latest

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
Latest
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
Last edition
2024-08-20
Last publish date
2024-08-20T21:40:14.000381

tranusername—For System i5, the tranusername is derived from the “User Profile” field in the C/SC journal record (the “start transaction record”), that designates the start of a transaction under commitment control. For a pseudo transaction (created by the Change Selector when it bundles self-committing operations into an “umbrella” transaction), this user name is taken from the same field in the first journal record in that bundled transaction. For either transaction type, this user name value is written into the RP_USER_NAME column of the row in RP_TRANS for this transaction.

Suppose you have both self-committing operations and transactions under commitment control and you want to ensure that you obtain the actual updating user for each self-committed update. In this scenario, the "tranusername" is not really sufficient for audit purposes; only the first operation in a pseudo transaction will have the actual updating user for the update, and all others in the transaction inherit this user even though in the journal it might actually be a different user.

You can use the following expression to provide the updating user for both transaction types, for any replicated row:

begin returns char;
   /* was this row self-committing */
   if ( ispseudotran() )
       return rowjobuser();
   else
       return tranusername();

end;