Transaction Management
Correlating logs across LWC → Apex → Flow boundaries using transaction management for end-to-end traceability.
Transaction Handling & Correlation
Apex (Controller Entry)
@AuraEnabled(cacheable=false)
public static List<Opportunity> loadOpps(Id accountId, String txId) {
if (String.isNotBlank(txId)) Triton.instance.resumeTransaction(txId);
else Triton.instance.startTransaction();
// Set up template for opportunity loading
Triton.instance.setTemplate(
Triton.makeBuilder()
.category(TritonTypes.Category.Apex)
.type(TritonTypes.Type.Backend)
.area(TritonTypes.Area.OpportunityManagement)
.relatedObject(accountId)
);
try {
// ... do work
Triton.instance.log(
Triton.instance.fromTemplate()
.level(TritonTypes.Level.INFO)
.summary('Loaded opportunities')
.details('accountId=' + accountId)
);
return [SELECT Id, Name, Amount FROM Opportunity WHERE AccountId = :accountId LIMIT 200];
} catch (Exception e) {
Triton.instance.log(
Triton.instance.fromTemplate()
.exception(e)
);
throw e;
} finally {
Triton.instance.stopTransaction();
}
}LWC (Passing Transaction Across)
Real-World Example: Multi-Step Lead Conversion Process
Transaction ID Flow
Best Practices
Transaction Lifecycle
Correlation Strategies
Performance Considerations
Last updated