Feeds:
Posts
Comments

Posts Tagged ‘zee’

This is quite a simple one for the DBAs. If you get stumped with a SQL agent error for your machine name, details are listed as follows:

Error: Could not find server in sysservers. Execute sp_addlinkedserver to add the server to sysservers. The statement has been terminated.

Solution:

  1. Open SSMS and verify that SQL Server name is correct
    use master
    Select @@Servername
    
  2. Run the following command
    Use Master
    GO
    Sp_DropServer 'myServer123'
    GO
    Use Master
    GO
    Sp_Addserver 'myServer786', 'local'
    GO
    
  3. Restart SQL Server service
  4. Re-run command on step#1. This should return back the correct machine name

Happy coding 🙂

Read Full Post »

LightNEasy

I haven’t had the chance to spread it across. Pasting it from the MSDN site..

Info:
During the recent months a group of world wide MVPs and Field Experts answered to create this series.

We call this series BizTalk 2009 Light and Easy Webcast Series and we cover16 different topics all listed under the downloads page.

Contents:
LightNEasy_Contents

Download pageClick here

Special thanks to Mick Badran for taking the effort in getting the whole series published.

Happy learning 🙂

Read Full Post »

01_T4Editor_ScreenShot

 

T4 templates are yet another way to add generated code via templates into your projects. It plugs directly into VS 2005/ 2008. The idea is generate code output via templates which can then be used directly from your custom application.

 

 

 

 A common sample would be to generate a data-layer out of our SQL database. This data-layer (C# or VB code) is then used by our custom application. Here is a sample run to generate class objects from our SQL database.

02_T4Editor_CodeWindow
Add the project type : TXT file with .tt extension

Add a text file

Initially the file does not appear as a template . Change the extension to .tt. Different blocks can be added to the template – more like ASP.Net

03_T4Editor_Intellisense
Intellisense is available as illustrated in the screen shot

Behind the .tt file a .cs is being generated. This is based on the template file being written (.tt extension). Using the “output extension directive” this can be changed to a VB if you like !

05_T4Editor_LanguageOptions

Here is a side-by-side comparion of writting a template file, and the output (.vb file) being produced as we type.

04_T4Editor_CodeGeneration

I’ve tested out two options to generate the output code:

1)     Direct inline code (also includes writting expressions as loops, etc)

2)     Call external source code and (sub) functions

Everything within the brace gets generated as an output
06_T4Editor_Loop
.tt template: Using loops

07_T4Editor_LoopOutput
Output for the above template

Note: When accessing external assembly à we need to add the fully qualified name to the template

08_T4Editor_DatabaseTemplate
.tt template: Generate Database objects.Get the names of all the tables in the Northwind database and generate the respective class objects.

09_T4Editor_DatabaseOutput

Sample output: Respective database classes generated

As an alternative – have a look into the Entity Framework and the WCF Adapters to generate the datalayer for your projects

 Reference:
Sample code and videos: http://www.visualt4.com/

Happy coding 🙂

Read Full Post »

This document helps you understand the key technologies from Microsoft and IBM in the integration space.  It then compares and contrasts the various products and technologies.

 This document was done in 2005. I’m not sure if there is an updated study to compare the two offerings?

Document: Click here

Read Full Post »

Here is a small code snippet to extract the strong name value from a BizTalk message stream.

 

//messageStream is the stream extracted from the BizTalk pipeline context

XmlDocument xmlDoc = new XmlDocument();

xmlDoc.Load(messageStream);

 

string documentMessageType = xmlDoc.DocumentElement.NamespaceURI + “#” + xmlDoc.DocumentElement.LocalName;

 

IDocumentSpec documentSpec = pContext.GetDocumentSpecByType(documentMessageType);

 

string documentStrongName = documentSpec.DocSpecStrongName;

 

Happy coding J

Read Full Post »

Consulting with one of my colleague on a BizTalk assignment, we came across a performance question while calling web-services from a BizTalk application. The application was quite simple in BizTalk terms doing the following:

 

1)     Input is an xml file (around 1KB in size)

2)     BizTalk consumes the file and sends it to a web-service (SOAP Adapter)

3)     The web-service is a dummy service that just returns back “Hello world”

 

 

We measured the overall response time for a load of 25, 50 and 100 concurrent users. The BizTalk solution consists of a simple orchestration that receives the message à calls the web-service and logs the response. To our surprise, for a load of about 100 users the web-service response time increased to about 2.42 seconds – which is unacceptable!

 

After looking on to several fronts and performance tuning with the recommendations the response time was no better! Some of the major steps we under took during the process are as follows:

·      Increase the concurrent connection from 80 to 300 concurrent

·      Increased the SQL Max. Worker thread from 750 to 1600

·      Added the scope in the BizTalk Orchestration to reduce the no. of persistence points.

·      Distribute the host instances (Receive, Processing and Send)

·      All other points as mentioned in the blog entry (Click here)

Now the average response time decreased from 2.42 seconds to 2.32 (an improvement of 4% – still unacceptable!).

 

 

Solution:

Finally, we thought about removing the SOAP adapterand calling the services inline from C# code. This time around we could process 100 concurrent users with an average response time of about 1.1 seconds (improving 54% from our original time).  Here is the screen shot using load runner.

performanceloadrunner

 

 Explanation: 

 

The problem is that both the Orchestration Engine and the SOAP/HTTP stack share the same .NET process, and hence the same threadpool. For many scenarios, this might not be an issue. For inline Web service/HTTP sends, however, it often is. Both the Orchestration Engine and the SOAP/HTTP stacks make aggressive use of the .NET threadpool.

 

Any threads that have not been used for 40 seconds will be deleted from the pool. When adding threads to the threadpool, it tries to avoid creating threads. The threadpool will try to create only one thread every 500 milliseconds. Under high-load conditions there is a good chance that you will run into this issue – say incase the thread pool has about 100 requests lined up.

 

Option 1:

Control the number of thread in the thread pool by using the following registry key – typicall setting the minimum value to the maximum.

 

Registry Key: HKLM\SYSTEM\CurrentControlSet\Services\BTSSvc$BizTalkServerApplication\CLR Hosting

 

Option 2:

Look into process isolation – this would using a different instance of the .NET threadpool executed in a separate address space from the BizTalk NT service. This approach provides a high level of isolation. Because you are in complete control of the work loaded onto the threadpool, its behavior is more predictable. This approach uses the COM+ application hosting model to avoid the issue of few threads. The other benefit it provides is disposing the transport component and the message after the method returns.

 

 

With a short time on our hand (about half a day!) – Option 1 served our purpose plus replacing the SOAP adapter with the inline webservice calls.

 

I can hear some of you saying, “Use the WCF adapter” – yeah – that’s another food for thought.
Thats all folks 🙂 

================================================

 Other Useful Posts   

 

================================================

 

Happy coding J

1)     Webservices and the 15 second delay

     Link: Click here and here   

 

2)     Microsoft BizTalk Server Performance Optimization Guide

     Link: Click here

 perfomancebiztalkoptimizationguide

 

3)     Troubleshooting MessageBox Latency Issues
Link: Click here

 

4)     Identifying BizTalk Bottlenecks
Link: Click
here 

 

Read Full Post »

With the ESB Guidance 2.0, I grabbed the Archive pipeline component in one of my projects. However, this component appears to be failing while archiving a flat file message in a send pipeline (Encode stage).

Error:
ForwardOnlyEventingReadStream does not support Seek() 

 

This is original source code in the Archive component

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage message)

{

          ….

        finally

            {

                if (binWriter != null)

                {

                    binWriter.Flush();

                    binWriter.Close();

                }

                if (originalStrm != null)

                    originalStrm.Seek(0, SeekOrigin.Begin);

            }

         

          return message;

}

Solution:
In order to get away with the error, replace it with the following code:

 

public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage message)

{

      ….

      finally

            {

                if (binWriter != null)

                {

                    binWriter.Flush();

                    binWriter.Close();

                }

                if (originalStream != null)

                {

                    if (!originalStream.CanSeek)

                    {

                       

                        ReadOnlySeekableStream seekableStream = new                                   ReadOnlySeekableStream(originalStream);

                  seekableStream.Position = 0;
                        message.BodyPart.Data = seekableStream;
   
                    }

                    else

                        originalStream.Seek(0, SeekOrigin.Begin);

                }

            }

 

            return message;

        }

 

The ReadOnlySeekableStream is part of the Microsoft.BizTalk.Streaming assembly.

 

 

Happy saving ..err – archiving J

 

Read Full Post »

Older Posts »