Monday, September 24, 2012

Transaction Audit Information Log - TAIL


Transaction Audit Information Log is a component in MDM Server used to store the audit information associated with mdm server transactions.

This component will be helpful when we are tracking a particular transaction/particualr set of transaction for its behaviour.

For eg: how many times a custom BP is getting invoked,what all are the channels invoking it,what time we are having maximum load/request for a particular transaction etc.

From the name itself it says ,it is an inforamtion log ,so the information should be stored somewhere so that it can be retreived.

The main tables are TRANSACTIONLOG,TRANSACTIONLOGERR(i think it is there only from 9.0.x++) not sure about the lower version.
(A few more tables to log the keys like party id etc are availble pls refere the developer guide for them )
Then how do we retreive these info from the tables ?
Hey we got OOTB transactions like getTransactionLog to do so.
I will try to give a high level picture about the configurations required for enabling TAIL in MDM.

Global :
The TAIL feature is enabled by setting the following property in CONFIGELEMENT
/IBM/DWLCommonServices/TAIL/enabled to true.

By default it will be disbaled.
This configuration we call as the global tail configuration.
Now there are 2 flavours of TAIL.

Sync vs Asycn

I know you already guessed out the difference from the name.

The difference is ,for synchronus behaviour ,the TAIL information should gets lgged along with the transaction as a single unit of work.

i.e the transaction for eg:addPerson(for which we enabled TAIL) is complete only after the TAIL info is logged in the TAIL tables.

In the asychronus way the TAIL info are pushed to TAILQueue(hope u remember this queue-if u dont then have alook at the AdminConsole for the queue configurations) first.

But we cannot run our getTransactionLog txn against a data in the queue,hence what will we do ?

We should have our data some how in the table.Dont worry about that.There is an MDB(Message Driven Bean) TAILMDB which listens to the TAILQueue.

So when ever a message is placed in the tail queue the onMessage() of the MDB gets invoked and this function will call the addTransactionLog function and

write the data to our tables.Hence writing to the tables happens as a seperate unit of work and doesnt stops you transctions(say addPerson) from being complete.

Hence it is called asynchronus.
The configuration for this is /IBM/DWLCommonServices/TAIL/Asynchronous/enabled should be true to enable the same.

Now we need to define for which transaction the TAIL should be enabled.This is done at the CDBUSINESSTXTP with the LOG_IND.

Set this to Y for transactions you need to have the TAIL enabled.There is again a concept of external vs internal transaction which is clearly explained in the developer guide.

Now one behaviour of TAIL we observed is.Assume we have disabled TAIL for a composite transaction in CDBUSINESSTXTP.The global and async are enabled.
/IBM/DWLCommonServices/TAIL/enabled TRUE

/IBM/DWLCommonServices/TAIL/Asynchronous/enabled TRUE


When the transaction say addCustomer(say implemented as a BP) runs successfully nothing will be logged in the tables as we have disbaled tail in the CDBUSINESSTXTP.

But for failures in the transaction the details will be logged in the table.This is governed by another property

/IBM/DWLCommonServices/TAIL/LogNegativeCompositeTransaction/enabled.If the property is enabled I mean set to TRUE , it will log the failures and it will do it for composites only.Look for transactionlogerr table for the error reson code and the error message.

Consider the case where you want to enable TAIL for a custom business proxy ,say maintainCustomerBP(which add/updates).
Enable :
maintainCustomerBP - CDBUSINESSTXTP Y BUSINESS_TX_TP_CD (say 200000).
Also you want to log the party id which is getting add/updated in the EXTERNALLOGTXNKEY.
The transactions called from a BP will not get logged in the TRANSACTIONLOG.(i.e addPerson,addContract,updateParty etc
 called from the custom BP doesnt gets logged even if you enable them in CDBUSINESSTXTP).
To log the partyid,contract id you need to do the below config.
I have an extensio for both if you dont have just use Party or Contract.
With the above config ,you will start seeing entries in your  EXTERNALLOGTXNKEY.

1 comment: