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

Connect CDC System Reference Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect CDC (MIMIX Share)
Version
5.8
Language
English
Product name
Connect CDC
Title
Connect CDC System Reference Guide
Copyright
2024
First publish date
2003
ft:lastEdition
2024-02-12
ft:lastPublication
2024-02-12T15:11:59.486869

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;