2017-08-09 120 views
1

我试图从SourceDb(存在于本地计算机上)到TargetDb(存在于azure &上,可以从SSMS访问)设置序列容器中的数据流任务。 每当我根据需要使用事务运行包时,我遇到了以下错误。用于分布式事务的SSIS错误代码DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER

错误:SSIS错误代码DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER。 AcquireConnection方法调用连接管理器“TargetDb”失败,错误代码为0xC0202009。在此之前可能会发布错误消息,并提供更多关于为什么AcquireConnection方法调用失败的信息。

它工作,如果我删除该容器的交易。我已正确设置所有分布式事务设置。我经历了堆栈溢出的很多链接,但没有为我工作。请建议解决方案。

我也试过这个过程,通过在我的本地机器上恢复这两个数据库。它成功处理交易。包装没有任何问题。

回答

2

为了在ssis中使用事务,您需要打开分布式事务协调器。另一种方法是在execute sql任务中使用begin Transaction,并在控制流中设置retainsameconnection = True,并且所有需要在事务中执行的dft任务将在此之后执行,最后一个任务将是另一个执行sql任务并提交交易。 按照以下链接使用交易,无需在分布式交易中使用交换机 - https://www.mssqltips.com/sqlservertip/3072/sql-server-integration-services-ssis-transactions-without-msdtc/

+0

不幸的是,DTC(由MSDTC服务控制)不能在Azure上使用。 –

+0

我已经用另一个替代方案更新了我的答案 – sam

+0

谢谢@sam它的工作。 – Pavvy

1

Azure无法参与与本地SQL Servers AFAIK的交易。

Limitations The following limitations currently apply to elastic database transactions in SQL DB:

  • Only transactions across databases in SQL DB are supported. Other X/Open XA resource providers and databases outside of SQL DB cannot participate in elastic database transactions. That means that elastic database transactions cannot stretch across on premises SQL Server and Azure SQL Databases. For distributed transactions on premises, continue to use MSDTC.
  • Only client-coordinated transactions from a .NET application are supported. Server-side support for T-SQL such as BEGIN DISTRIBUTED TRANSACTION is planned, but not yet available.
  • Transactions across WCF services are not supported. For example, you have a WCF service method that executes a transaction. Enclosing the call within a transaction scope will fail as a System.ServiceModel.ProtocolException.

有关分布式事务和Azure的完整讨论,请参阅this documentation at Microsoft

+0

谢谢。我没有意识到这一点。 – Pavvy