Problem: How to print the Transaction ids inside the Application Logging for better tracability? Resolution: Product Name: Borland Enterprise Server Product Version: 6.5 (and above) Product Components: Transaction Service Platform/OS version: Windows 2003 JDK: 1.4.2 For a running application in which a transaction can be triggered from multiple entry points, the analysis of the trace files become critical and it demands clear demarcation of transaction. In another word, you need to print the "current transaction id" in the Application logs. You can either use following API to print a hashcode [e.g. 1111492610] of the current transaction in application log: com.visigenic.services.CosTransactions.GenericKey key = com.inprise.j2ee.utils.TxUtils.getCurrentGenericKey (); or this API to fetch the otid: org.omg.CosTransactions.otid_t otid = com.inprise.j2ee.utils.TxUtils.getCurrentIOtid (); It returns the otid as defined in CosTransactions.idl struct otid_t { long formatID; long bqual_length; sequence octet tid; }; (NOTE: for the most part, the structures are used behind the scenes. You would not reference them directly) Recommended Readings : VisiTranction Guide: Chapters "Managing Heuristic Decisions" and "Using VisiBroker Console" Author: Chetna Bakshi Old KB# 15592
↧
Wiki Page: How to print the Transaction ids inside the Application Logging for better tracability?
↧