Showing posts with label BizTalk. Show all posts
Showing posts with label BizTalk. Show all posts

Friday, December 10, 2010

Tracking Database Service Instances Aggregation SQL Script

This script is an example to aggregate data of Service Instances from the tracking database (BizTalkDTADb):

SELECT
    dta_Svc.strServiceName + '_' + dta_SvcSta.strState AS 'Service Name'
    , COUNT(*) AS 'Number of Hits'
    , MAX(DATEDIFF(millisecond, [dta_SI].dtStartTime, [dta_SI].dtEndTime)) AS 'Maximum Execution Time'
    , AVG(CONVERT(BIGINT, DATEDIFF(millisecond, [dta_SI].dtStartTime, [dta_SI].dtEndTime))) AS 'Average Execution Time'
    , MIN(DATEDIFF(millisecond, [dta_SI].dtStartTime, [dta_SI].dtEndTime)) AS 'Minimum Execution Time'
FROM [BizTalkDTADb].[dbo].[dta_ServiceInstances] [dta_SI]
INNER JOIN
    [BizTalkDTADb].[dbo].[dta_Services] dta_Svc ON [dta_SI].uidServiceId = dta_Svc.uidServiceId
INNER JOIN
    [BizTalkMgmtDb].[dbo].[bts_assembly] bts_ass ON dta_Svc.strAssemblyName = bts_ass.nvcFullName
INNER JOIN
    [BizTalkDTADb].[dbo].[dta_ServiceState] dta_SvcSta ON [dta_SI].nServiceStateId = dta_SvcSta.nServiceStateId

WHERE
      [dta_SI].dtEndTime IS NOT NULL
GROUP BY dta_Svc.strServiceName, dta_SvcSta.strState
ORDER BY dta_Svc.strServiceName

The sample result of the script is:
In my case, this script is further enhanced by filtering to get only the last 5 minutes tracked service instances and wrapped as a stored procedure. The data from the stored procedure is used to feed the monitoring system.

Tuesday, November 30, 2010

Host cannot be deleted: there are suspended service instances for this host which need to be removed

I experienced this error when I tried to delete unused host in my BizTalk environment:

In my case, there are no suspended service instances for the related host.

After further research, there is subscription related with the host. You can check the subscription in the Subscription table of BizTalkMsgBoxDb:

SELECT *
  FROM [BizTalkMsgBoxDb].[dbo].[Subscription]
  WHERE nvcApplicationName = 'HostName'

If the query result returns row(s), then you have to remove the subscription with the related host. In my case, there is a dynamic send port related with the host. I un-enlist the send port and re-try to remove the host. That's it!

Monday, July 19, 2010

Orchestrations failed to be (re)deployed due to binding errors

If you experience errors when you try to (re)deploy orchestrations through your visual studio (due to cached Binding Information):

You can solve this problem either by:
  1. Set the Redeploy property of your Orchestrations project to false (right click the orchestration project, choose properties, choose deployment on the left panel, and set the Redeploy value under general on the right panel to False).
  2.  
  1. Or clear the deployment binding information of visual studio by deleting them in C:\Documents and Settings\[User Name]\Application Data\Microsoft\BizTalk Server\Deployment\BindingFiles or C:\Users\[User Name]\AppData\Roaming\Microsoft\BizTalk Server\Deployment\BindingFiles.You can delete the whole folder if you want to. By deleting this, you enforce visual studio to create new binding information.

Afterward, you can retry the deployment.

    Wednesday, February 24, 2010

    The adapter Microsoft Dynamics AX 2009 raised an error message: "The message does not contain a body part."

    I experienced this error when trying to update a data synchronously with AIF. This same error also happens with delete service.

    For now, Rasmus Jaeger said that the workaround is:
    A simple check, in the AIF update and delete services in AX, which checks if the message part is empty. If the message part is empty, AX returns a predefined static xml document to BizTalk. 
    So, we are waiting for the hot fix ............

    Note to Self: Invoking Static Members of a Class in BRE

    To invoke static members of a class, StaticSupport must be added in the registry:
    • For 32 bit, the location is in:
      HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BusinessRules\3.0\StaticSupport
    • For 64 bit, the location is in:
      HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\BusinessRules\3.0\StaticSupport

    Monday, February 15, 2010

    The Messaging Engine encountered an error during the processing of one or more inbound messages


    I experienced this error when a receive port disassembles a flat file in 2 cases: 
    • A 1 MB flat file contains more than 10000 rows
      The work around that I did is by throttling the Threads per CPU to 100.
    • A 30 MB flat file contains more than 300000 rows
      I noticed that the Memory used by the receive host has grown up more than 3 GB. The receive host is a 32-bit only host. Thus, it recycles the host. So, by using 64-bit host and also throttling the Threads per CPU, the flat file was processed successfully. The 64-bit receive host consumed more than 6 GB of memory.

    Saturday, November 21, 2009

    Note to Self: Add to The Global Assembly Cache on MSI Imports

    Lately, I've been busy with deployment and re-deployment of BizTalk solutions for testing purposes. In the deployment step, I just want to import the MSI and done. But, to do that, I also need to make sure that when I import the MSI, all the assemblies is also added to the GAC. So, I have to modify each of the resources and check the "Add to the global assembly cache on MSI imports (gacutil)" option. Well, it's quite annoying things to do if you need to do this for all the resources.

    Thanks to Dmitriy, I just need to run this query in the adpl_sat table of BizTalkMgmtDb database:
    update dbo.adpl_sat set properties = replace(cast(properties as nvarchar(4000)),
    'UpdateGacOnImport</key><value>
    False', 'UpdateGacOnImport</key><value>True') where applicationId = <app_id>

    Monday, November 16, 2009

    SSO Configuration Application MMC Snap-In

    I just knew that Microsoft has released MMC Snap-In to use SSO to store configuration data.

    Saravana has posted an example about this in his blog.

    Check it out!

    Saturday, November 14, 2009

    Which credential used by send port to communicate with Dynamics ?

    I configured my BizTalk application to run on three different host instances: receive, process, and send. I thought the credential used when BizTalk communicates with Dynamics is the Send Handler Host Instance credential. But I got the following error:



    The send handler host instance credential was the valid Dynamics user but the process host instance was not. When I switched the credential or changed the credential of process host instance into the valid Dynamics credential, it works fine.

    So, is this the way it should work?

    Monday, November 2, 2009

    BizTalk Expression Editor MAXIMIZER

    Randal has just posted a nice tool to maximize Expression Editor.

    Check it out !

    Sunday, September 27, 2009

    Visual Studio (2008) crash when trying to add pipeline components to toolbox

    I have been working on a pipeline components library. I encountered a strange issue when I tried to add a new pipeline component which I have added to the library. Every time I tried to "Choose Items..." in the pipeline components toolbox and choosed BizTalk Pipeline Components tab, my visual studio 2008 crashed. I don't remember whether I have encountered the same problem when I used visual studio 2005.

    Thanks to Thiago Almeida, I found the solution: add the pipeline components into the Toolbox when the entire solution closed.

    Thursday, May 21, 2009

    The Changes to the referenced assembly are not automatically picked up in BizTalk Project

    One of my colleagues encountered this issue when he used Visual Studio 2008.

    If your BizTalk project references another assembly, and that assembly is updated, the updates or changes are not automatically picked up in your BizTalk project.

    There are some alternatives to update the referenced assembly:

    1. You should remove the outdated reference in Solution Explorer, and then add the reference back (re-reference the assembly).
    2. Or, you can close your solution and reopen it. In either case, the latest updates to the referenced assembly are available to your project.
    3. Alternatively (as Samad Khan suggested): Select the updated assembly under references, Press F4 to bring up the properties windows, Set the “Copy Local” design time property from “True” to “False”, and Change back the design time property “Copy Local” from “False” to “True”.