Using Transaction Control transformations in mappings
Transaction Control transformations are transaction generators. They define and redefine transaction boundaries in a mapping. They drop any incoming transaction boundaries from an upstream active source or transaction generator, and they generate new transaction boundaries downstream.
Transaction Control transformations can be effective or ineffective for the downstream transformations and targets in the mapping. The Transaction Control transformation becomes ineffective for downstream transformations or targets if you put a transformation that drops incoming transaction boundaries after it. This includes any of the following active sources or transformations:
•Aggregator transformation with the All Input level transformation scope
•Java transformation with the All Input level transformation scope
•Joiner transformation with the All Input level transformation scope
•Rank transformation with the All Input level transformation scope
•Sorter transformation with the All Input level transformation scope
•SQL transformation that uses a saved or user-entered query and has the All Input level transformation scope
•Transaction Control transformation
•Any multiple input group transformation that is connected to multiple upstream transaction control points
Although a Transaction Control transformation may be ineffective for a target, it can be effective for downstream transformations. Downstream transformations with the Transaction level transformation scope can use the transaction boundaries defined by an upstream Transaction Control transformation.
The following image shows a valid mapping with a Transaction Control transformation that is effective for a Sorter transformation, but ineffective for the target:
In this example, TransactionControl_1 is ineffective for the target, but effective for the Sorter transformation. The transformation scope for the Sorter transformation is Transaction. It uses the transaction boundaries defined by TransactionControl_1. The transformation scope for the Aggregator transformation is All Input. It drops transaction boundaries defined by TransactionControl_1. Transaction control transformation TransactionControl_2 is an effective Transaction Control transformation for the target.
Sample transaction control mappings with multiple targets
In a mapping with multiple targets, a Transaction Control transformation can be effective for one target and ineffective for another target. If each target is connected to an effective Transaction Control transformation, the mapping is valid. If one target in the mapping is not connected to an effective Transaction Control transformation, the mapping is invalid.
The following image shows a valid mapping with both an ineffective and an effective Transaction Control transformation:
Data Integration processes TransactionControl_1, evaluates the transaction control expression, and creates transaction boundaries. The mapping does not include a transformation that drops transaction boundaries between TransactionControl_1 and Target_1, making TransactionControl_1 effective for Target_1. Data Integration uses the transaction boundaries defined by TransactionControl_1 for Target_1.
However, the mapping includes a transformation that drops transaction boundaries between TransactionControl_1 and Target_2, which makes TransactionControl_1 ineffective for Target_2. When Data Integration processes the Aggregator transformation, with transformation scope set to All Input, it drops the transaction boundaries defined by TransactionControl_1 and outputs all rows in an open transaction. Then Data Integration evaluates TransactionControl_2, creates transaction boundaries, and uses them for Target_2.
If a roll back occurs in TransactionControl_1, Data Integration rolls back only rows from Target_1. It does not roll back any rows from Target_2.
The following image shows an invalid mapping with both an ineffective and an effective Transaction Control transformation:
The mapplet, mplt_TransactionControl, contains a Transaction Control transformation. It is ineffective for Target_1 and Target_2. The transformation scope for Aggregator_1 is All Input. It is an active source for Target_1. The transformation scope for Aggregator_2 is All Input. It is an active source for Target_2. TransactionControl_2 is effective for Target_2.
The mapping is invalid because Target_1 is not connected to an effective Transaction Control transformation.