简体   繁体   English

从BizTalk动态发送端口执行SP

[英]SP execution from BizTalk dynamic send port

I have a sp which I am executing from BizTalk orchestration. 我有一个从BizTalk业务流程执行的sp。

When I am executing the SP in SQL server it's taking 10 sec, but when I am executing it from orchestration using below code, it's taking 1 hour. 当我在SQL Server中执行SP时,需要10秒钟,但是当我使用以下代码从业务流程中执行时,则需要1个小时。

  sqlStoredProcRequestXml = reportRequestXml;

  sqlStoredProcRequestXml(WCF.Action)= sqlProcedureName;
  sqlStoredProcRequestXml(WCF.BindingType)="sqlBinding";
  sqlStoredProcRequestXml(WCF.EnableTransaction) = false;

  sqlStoredProcRequestXml(WCF.BindingConfiguration)= @"<binding name=""sqlBinding"" sendTimeout=""02:30:00"" />";  

SndRcvSqlStoreProcRequestResponsePort(Microsoft.XLANGs.BaseTypes.Address)="mssql://" + dbServer + "//" + dbDatabase; SndRcvSqlStoreProcRequestResponsePort(Microsoft.XLANGs.BaseTypes.Address)=“ mssql://” + dbServer +“ //” + dbDatabase; SndRcvSqlStoreProcRequestResponsePort(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-SQL"; SndRcvSqlStoreProcRequestResponsePort(Microsoft.XLANGs.BaseTypes.TransportType)=“ WCF-SQL”;

Can anyone explain why there is 1 hour diff in execution of the SP. 任何人都可以解释为什么执行SP会有1个小时的差异。

This don't explain such difference (1 hour vs 10 sec is a lot), but when you invoke from an Orchestration: 这并不能解释这种差异(1小时vs 10秒很多),但是当您从业务流程调用时:

  1. Your message first go to the Message Box 您的消息首先进入消息框
  2. The message is catched by the Send Port 邮件被发送端口捕获
  3. Send Port invokes the SP 发送端口调用SP
  4. The response then goes to the Message Box 响应然后转到消息框
  5. The Orchestration gets the response message form Message Box 业务流程从消息框获取响应消息

You aren't calling directly to your SP from the Orchestration, the message travels through BizTalk, but this don't explain so big difference, unless you have problems on your MsgBox. 您不是从业务流程直接调用SP,而是通过BizTalk传递消息,但这并不能解释太大的区别,除非您在MsgBox上遇到问题。

There is nothing specific to BizTalk delaying the sp call so much. BizTalk没有什么特别的延迟sp调用。 You can try following to find the root cause: 您可以尝试以下查找根本原因:

  1. Use SQL profiler to see the actual execution time of SP via BizTalk 使用SQL事件探查器通过BizTalk查看SP的实际执行时间
  2. Check for other delays in your environment, such as SQL performance, msgbox db, BizTalk host throttling 检查环境中的其他延迟,例如SQL性能,msgbox数据库,BizTalk主机限制
  3. Check event viewer log for any warning or error on send port host 检查事件查看器日志中是否有发送端口主机上的任何警告或错误
  4. Make sure you use same data and environment to test the SP outside BizTalk to compare result, sometime depending on size of data, yr query can run for long time in diff env. 确保您使用相同的数据和环境在BizTalk外部测试SP以比较结果,有时取决于数据大小,您的查询可以在diff env中长时间运行。
  5. You can also take DBAs help to sql profile your sp call 您还可以利用DBA帮助来对您的sp调用进行SQL配置文件

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM