Multi-Transaction Service
The Multi-Transaction Service (MTS) is integrated with the Digital Commerce Basket APIs to split Apex transactions into multiple transactions to avoid exceeding Salesforce Governor limits. Use its configuration settings to enable it:
-
MaxCPUTimePerTransaction: Sets the maximum allowed CPU time per Apex transaction before the transaction is split.
-
MaxHeapSizePerTransaction: Sets the maximum allowed heap size per Apex transaction before the transaction is split.
-
MTSEnabled: Enables the Multi-Transaction Service.
-
NumberOfDMLPerTransaction: Sets the maximum allowed data manipulation language (DML) statements per Apex transaction before the transaction is split.
-
NumberOfQueriesPerTransaction: Sets the maximum allowed SOQL queries per Apex transaction before the transaction is split.
The MTS supports long-running transactions and returns a multiTransactionKey
in the nexttransaction
action. To proceed, call the API again with the multitransactionKey
in the request payload as shown in the following example Add to Basket requests and responses with MTSEnabled set to true (the default).
Example Requests and Responses
Example Add to Basket Request
Example Intermediate Response
Example Request to Pass the multiTransactionKey
Example Response
This example is truncated.