Professional Documents
Culture Documents
By PenchalaRaju.Yanamala
Transformation type:
Active
Connected
PowerCenter lets you control commit and roll back transactions based on a set of
rows that pass through a Transaction Control transformation. A transaction is the
set of rows bound by commit or roll back rows. You can define a transaction
based on a varying number of input rows. You might want to define transactions
based on a group of rows ordered on a common key, such as employee ID or
order entry date.
When you run the session, the Integration Service evaluates the expression for
each row that enters the transformation. When it evaluates a commit row, it
commits all rows in the transaction to the target or targets. When the Integration
Service evaluates a roll back row, it rolls back all rows in the transaction from the
target or targets.
If the mapping has a flat file target you can generate an output file each time the
Integration Service starts a new transaction. You can dynamically name each
target flat file.
Note: You can also use the transformation scope in other transformation
properties to define transactions.
Transformation tab. You can rename the transformation and add a description
on the Transformation tab.
Ports tab. You can add input/output ports to a Transaction Control
transformation.
Properties tab. You can define the transaction control expression, which flags
transactions for commit, roll back, or no action.
Metadata Extensions tab. You can extend the metadata stored in the
repository by associating information with the Transaction Control
transformation.
Properties Tab
The expression contains values that represent actions the Integration Service
performs based on the return value of the condition. The Integration Service
evaluates the condition on a row-by-row basis. The return value determines
whether the Integration Service commits, rolls back, or makes no transaction
changes to the row. When the Integration Service issues a commit or roll back
based on the return value of the expression, it begins a new transaction. Use the
following built-in variables in the Expression Editor when you create a transaction
control expression:
If the transaction control expression evaluates to a value other than commit, roll
back, or continue, the Integration Service fails the session.
Example
You want to use transaction control to write order information based on the order
entry date. You want to ensure that all orders entered on any given date are
committed to the target in the same transaction. To accomplish this, you can
create a mapping with the following transformations:
Sorter transformation. Sort the source data by order entry date.
Expression transformation. Use local variables to determine whether the date
entered is a new date.
The following table describes the ports in the Expression transformation:
Port Name Expression Description
DATE_ENTERED DATE_ENTERED Input/Output port.
Receives and passes the
date entered.
NEW_DATE IIF(DATE_ENTERED=PREVDATE, Variable port.
0,1) Tests current value for
DATE_ENTERED against
the stored value for
DATE_ENTERED in the
variable port, PREV_DATE.
PREV_DATE DATE_ENTERED Variable port.
Receives the value for
DATE_ENTERED after the
Integration Service
evaluates the NEW_DATE
port.
DATE_OUT NEW_DATE Output port.
Passes the flag from
NEW_DATE to the
Transaction Control
transformation.
Note: The Integration Service evaluates ports by dependency. The order in which
ports display in a transformation must match the order of evaluation: input ports,
variable ports, output ports.
Mappings with Transaction Control transformations that are ineffective for targets
may be valid or invalid. When you save or validate the mapping, the Designer
displays a message indicating which Transaction Control transformations are
ineffective for targets.
Mapping Guidelines and Validation
Use the following rules and guidelines when you create a mapping with a
Transaction Control transformation:
If the mapping includes an XML target, and you choose to append or create a
new document on commit, the input groups must receive data from the same
transaction control point.
Transaction Control transformations connected to any target other than
relational, XML, or dynamic MQSeries targets are ineffective for those targets.
You must connect each target instance to a Transaction Control transformation.
You can connect multiple targets to a single Transaction Control transformation.
You can connect only one effective Transaction Control transformation to a
target.
You cannot place a Transaction Control transformation in a pipeline branch that
starts with a Sequence Generator transformation.
If you use a dynamic Lookup transformation and a Transaction Control
transformation in the same mapping, a rolled-back transaction might result in
unsynchronized target data.
A Transaction Control transformation may 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. See Sample
Transaction Control Mappings with Multiple Targets for an example of a valid
mapping with an ineffective Transaction Control transformation.
Either all targets or none of the targets in the mapping should be connected to
an effective Transaction Control transformation. See Sample Transaction
Control Mappings with Multiple Targets for an example of an invalid mapping
where one target has an effective Transaction Control transformation and one
target has an ineffective Transaction Control transformation
In the Mapping Designer, click Transformation > Create. Select the Transaction
1.Control transformation.
2.Enter a name for the transformation.
The naming convention for Transaction Control transformations is
TC_TransformationName.
3.Enter a description for the transformation.
This description appears when you view transformation details in the Repository
Manager, making it easier to understand what the transformation does.
4.Click Create.
The Designer creates the Transaction Control transformation.
5.Click Done.
6.Drag the ports into the transformation.
The Designer creates the input/output ports for each port you include.
7.Open the Edit Transformations dialog box, and select the Ports tab.
You can add ports, edit port names, add port descriptions, and enter default
values.
Select the Properties tab. Enter the transaction control expression that defines
8.the commit and roll back behavior.
Select the Metadata Extensions tab. Create or edit metadata extensions for the
9.Transaction Control transformation.
10.Click OK.