Sunteți pe pagina 1din 4

Transaction Control

Power Center 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 I or order entry date. In Power Center, you define transaction control at the following levels! Within a mapping. "ithin a mapping, you use the Transaction Control transformation to define a transaction. You define transactions using an e#pression in a Transaction Control transformation. $ased on the return value of the e#pression, you can choose to commit, roll back, or continue without any transaction changes. Within a session. "hen you configure a session, you configure it for user%defined commit. You can choose to commit or roll back a transaction if the Integration &ervice fails to transform or write any row to the target. "hen you run the session, the Integration &ervice evaluates the e#pression for each row that enters the transformation. "hen it evaluates a commit row, it commits all rows in the transaction to the target or targets. "hen the Integration &ervice 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 &ervice starts a new transaction. You can dynamically name each target flat file. Properties Tab 'n the Properties tab, you can configure the following properties! Transaction control e#pression Tracing level (nter the transaction control e#pression in the Transaction Control Condition field. The transaction control e#pression uses the II) function to test each row against the condition. *se the following synta# for the e#pression! IIF (condition, value1, value2) The e#pression contains values that represent actions the Integration &ervice performs based on the return value of the condition. The Integration &ervice evaluates the condition on a row%by%row basis. The return value determines whether the Integration &ervice commits, rolls back, or makes no transaction changes to the row. "hen the Integration &ervice issues a commit or roll back based on the return value of the e#pression, it begins a new transaction. *se the following built%in variables in the (#pression (ditor when you create a transaction control e#pression!

TC C!"TI"#$ T%&"'&CTI!". The Integration &ervice does not perform any transaction change for this row. This is the default value of the e#pression. TC C!((IT )$F!%$. The Integration &ervice commits the transaction, begins a new transaction, and writes the current row to the target. The current row is in the new transaction. TC C!((IT &FT$%. The Integration &ervice writes the current row to the target, commits the transaction, and begins a new transaction. The current row is in the committed transaction. TC %!**)&C+ )$F!%$. The Integration &ervice rolls back the current transaction, begins a new transaction, and writes the current row to the target. The current row is in the new transaction. TC %!**)&C+ &FT$%. The Integration &ervice writes the current row to the target, rolls back the transaction, and begins a new transaction. The current row is in the rolled back transaction. If the transaction control e#pression evaluates to a value other than commit, roll back, or continue, the Integration &ervice fails the session. (apping ,uidelines and -alidation *se the following rules and guidelines when you create a mapping with a Transaction Control trans.ormation/ If the mapping includes an +,- 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, +,-, or dynamic ,.&eries 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 &e/uence 0enerator transformation. If you use a dynamic -ookup transformation and a Transaction Control transformation in the same mapping, a rolled%back transaction might result in unsynchroni1ed 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.

(ither all targets or none of the targets in the mapping should be connected to an effective Transaction Control transformation. $0ample to Transaction Control/ 'tep 1/ esign the mapping.

'tep 2/ Creating a Transaction Control Transformation. In the ,apping esigner, click Transformation 2 Create. &elect the Transaction Control transformation. (nter a name for the transformation.3 The naming convention for Transaction Control transformations is TC4Transformation5ame6. (nter a description for the transformation. Click Create. Click one. rag the ports into the transformation. 'pen the (dit Transformations dialog bo#, and select the Ports tab. &elect the Properties tab. (nter the transaction control e#pression that defines the commit and roll back behavior.

0o to the Properties tab and click on the down arrow to get in to the e#pression editor window. -ater go to the 7ariables tab and Type II)8(,pno9:;<=,> select the below things from the built in functions. IIF ($(P"!12345,TC C!((IT )$F!%$,TC C!"TI"#$ T%&"'&CTI!") Connect all the columns from the transformation to the target table and save the mapping.

&elect the ,etadata (#tensions tab. Create e#tensions for the Transaction Control transformation. Click '?. 'tep 6/ Create the task and the work flow. 'tep 5/ Preview the output in the target table.

or

edit

metadata

S-ar putea să vă placă și