Search code examples
ssiscommitrollback

ROLLLBACK and COMMIT transaction issue in SSIS package


I am trying to do a ROLLBACK and COMMIT transaction in SSIS package.The commit transaction is working fine.For the rollback transaction i inserted null value to a column which's data type is money.Here iam getting an error in DFT and Commit SQLtask.Please give me a solution,

I changed the CONTROLLFLOW properties--->TransactionRequired to Required

In DFT TransactionRequired---->Supported

Please help me friends Thanks in advance

The errors are shown below

[Execute SQL Task] Error: Executing the query "Rollback tran" failed with the following error: "Distributed transaction completed. Either enlist this session in a new transaction or the NULL transaction.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80040E21. An OLE DB record is available. Source: "Microsoft SQL Server Native Client 11.0" Hresult: 0x80040E21 Description: "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.".

[OLE DB Destination [2]] Error: There was an error with OLE DB Destination.Inputs[OLE DB Destination Input].Columns[CustomerAmount] on OLE DB Destination.Inputs[OLE DB Destination Input]. The column status returned was: "The value violated the integrity constraints for the column.".

[OLE DB Destination [2]] Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "OLE DB Destination.Inputs[OLE DB Destination Input]" failed because error code 0xC020907D occurred, and the error row disposition on "OLE DB Destination.Inputs[OLE DB Destination Input]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.

[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "OLE DB Destination" (2) failed with error code 0xC0209029 while processing input "OLE DB Destination Input" (15). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.


Solution

  • You are missing two approaches with SSIS and transaction handling. If you are using SSIS native transactions (setting TransactionRequired=Required), you do not need to call Rollback. Transaction will be rolled back automatically if an error will occur or you deliberately set an error. Important thing to notion - transaction scope, i.e. when it will commit. My recommendation - declare transaction on dedicated Sequence Container; transaction will be committed when leaving this Sequence Container.
    If you want to use transaction handling with SQL Commit and Rollback, you do not use TransactionRequired=Required. It is a special case for MS SQL, for details see The implementation of Transaction with out msdtc in the design pattern and TransactionOption in SSIS.