BizTalk Server:WCF SQL适配器发送端口 - 尝试/捕获不按预期工作 [英] BizTalk Server : WCF SQL Adapter Send Port - Try/Catch Not Working As Expected

查看:86
本文介绍了BizTalk Server:WCF SQL适配器发送端口 - 尝试/捕获不按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从发送端口(WCF-SQL)调用存储过程时,CATCH块是 每次都没有执行。

When calling stored procedure form the Send Port (WCF-SQL) , the CATCH block is  not executed everytime.

例如,对于数据转换不匹配错误,应该已经执行了Catch块,并且应该在SQL Respone中返回错误消息(分配给OUTPUT SQL变量)架构,但发生的事情是,发送端口被错误地挂起了
- "遇到错误,交易回滚等等"。

For example, for the Data Conversion Mismatch error, the Catch block should have been executed and Error Message(assigned to OUTPUT SQL variable) should have been returned in the SQL Respone Schema, But what happened is, the Send Port got suspended with the error - "Error encountered, Transaction Rolled Back etc. etc.".

我该如何制作确保在存储过程中遇到的每个错误都执行了Catch Block。

How shall I make sure that Catch Block gets executed for each and every error encountered inside Stored Procedure.

推荐答案

你指的是哪个catch块? SQL catch块或业务流程内部?

which catch block are you referring to ? SQL catch block or inside the orchestration ?

如果批处理中发生运行时语句错误(例如违反约束),则
数据库引擎中的默认行为是滚动仅返回生成错误的语句。您可以使用SET XACT_ABORT语句更改此行为。执行SET XACT_ABORT ON后,任何运行时语句错误都会导致当前事务的自动回滚。
编译错误(例如语法错误)不受SET XACT_ABORT的影响。有关更多信息,请参阅SET XACT_ABORT(Transact-SQL)。

https://docs.microsoft.com/en-us/previous-versions/sql/sql- server-2005 / ms175523(v = sql.90)

https://docs.microsoft.com/en-us/previous-versions/sql/sql-server-2005/ms175523(v=sql.90)


这篇关于BizTalk Server:WCF SQL适配器发送端口 - 尝试/捕获不按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆