by community-syndication | Jun 19, 2007 | BizTalk Community Blogs via Syndication
————————————-
Addendum – June 22 2007: Under absolutely NO circumstances should you modify the data model of the BizTalk databases in any way. You should only optimize your own application databases.
————————————-
I have seen this issue in many places, which still surprises me because there are a lot of blog entries about this. For what it’s worth, here’s one more.
Scenario: BizTalk solution makes moderate to heavy use of SQL adapter in calling stored procedures in a database.
Problem: SQL server shows many blocking (perhaps deadlocking) SPIDs, most of which are owned by the BizTalk host instance account.
Factors:
- The longer the procedure takes to execute, the worse off you are
- Big tables, poor logic, bad indexes, bad db maintenance, disk contention etc.
- The more concurrent procedure executions the worse off you are
- short polling interval
- multiple ports
- multiple host instances
Diagnosing:
- Enterprise Manager or Management Studio can give some insight to active and blocking spids (check to see who owns the blocking spid and use dbcc inputbuffer to see the sql it is executing)
- Try using sp_who,sp_who2,and sp_who3, they may give you lots of insight
- Call MS PSS (or download pssdiag for yourself from the MS download site) and have them configure a pssdiag trace for you. Look especially closely at the blocker output and the profiler trace. Use rml.exe (read80trace) to generate a report of the “worst offenders” sql scripts or procedures.
Fixes:
- As per documentation, don’t use T-SQL transactions in your proc. The SQL Adapter already has this all wrapped up in a distributed transaction so relax!
- As per documentation, you can try setting the transaction isolation level to READ COMMITTED, or perhaps REPEATABLE READ. If you are running SERIALIZABLE that is a great way to tank performance and cause blocking.
- Speed up the procs (Archive, purge, index, create views, run db maintenance, buy a big SAN, whatever. The locks won’t kill you if they don’t last)
- Don’t go silly with coarse locking hints. Keep your lock few in number and small in granuarity. If you must manually lock, then please read up on the READPAST hint – especially for queue or “trigger” tables. (Thanks to Kunjal K for this hint)
- Reduce concurrency – You can try lengthening your polling interval or reducing the number of host instances that run that port.
Didn’t find what you were looking for? Try one of these:
- Known SQL Adapter Issues
- How to resolve a deadlock
- Understanding Isolation Levels
- Contact me through comment below
Is there something that I can do to make this blog more helpful to you?
I welcome your feedback!
by community-syndication | Jun 19, 2007 | BizTalk Community Blogs via Syndication
This will be the first of many blog postings on this new MSDN blog site. I’ll start off with a bunch of BizTalk, SQL, and .NET stuff. I have no idea where it will go from there, but I’ll try to practice all of my lessons learned from my previous blog and keep the community happy as much as is possible. (I recommend reading the Automatic Account Creation post for BizTalk. By far, it was my most popular entry.
Thanks for stopping by, and please, send requests if you have them.
by community-syndication | Jun 19, 2007 | BizTalk Community Blogs via Syndication
I’ve made the switch over to Microsoft Consulting Services from my previous employer, so my blog will be moving!
Please check out my new blog at http://blogs.msdn.com/neilth
by community-syndication | Jun 19, 2007 | BizTalk Community Blogs via Syndication
Back on the old blog, I posted about creating web services for BizTalk that accepted generic XML. In one of my current projects, a similar scenario came up. We have a WSDL that we must conform to, but wanted to accept generic content and validate AFTER the message reaches BizTalk.
Our SAP system will […]
by community-syndication | Jun 18, 2007 | BizTalk Community Blogs via Syndication
A flat file schema can be configured to generate empty elements for empty content
– using the “Generate Empty Nodes” option.
It seems that at runtime, the flat file dissasembler can generate “<foo></foo>”
for these empty nodes in cases where “Validate Instance…”
in the IDE would have generated “<foo/>”.
Where this can cause pain is if you receive a message like: “<foo><bar></bar></foo>”
into your orchestration, and then do a series of assignments like:
xmlDocVariable = myMessage;
// xmlDocVariable2 initialized because xmlDocVariable is needed for other things...
xmlDocVariable2.LoadXml(xmlDocVariable.OuterXml);
myMessage2 = xmlDocVariable2;
At this point, myMessage2 is going to be the serialized representation of xmlDocVariable2.
By default, you will now get:
<foo>
..<bar>
..</bar>
</foo>
Notice you now have carriage returns, line feeds, and spaces (shown here as periods)
involved. Depending on how you now go after /foo/bar, this can be bad (i.e.
you won’t get empty content when you might expect it.) You can avoid this
behavior by doing:
xmlDocVariable2.LoadXml(xmlDocVariable.OuterXml);
xmlDocVariable2.PreserveWhitespace = true;
myMessage2 = xmlDocVariable2;
Thanks to Tomas and Carlos for
setting me straight on PreserveWhitespace – I was trying to set it before the
call to LoadXml, and this doesn’t work. Never a dull day in BizTalk land…
The documentation
for PreserveWhitespace is a little strange. This functionality would seem
to be better represented as parameters to Load/Save, rather than as a property…
“If PreserveWhitespace is true before Load or LoadXml is called, white
space nodes are preserved; otherwise, if this property is false, significant white
space is preserved, white space is not. If PreserveWhitespace is true before
Save is called, white space in the document is preserved in the output; otherwise,
if this property is false, XmlDocument auto-indents the output.”
by community-syndication | Jun 18, 2007 | BizTalk Community Blogs via Syndication
A flat file schema can be configured to generate empty elements for empty content
– using the “Generate Empty Nodes” option.
It seems that at runtime, the flat file dissasembler can generate “<foo></foo>”
for these empty nodes in cases where “Validate Instance…”
in the IDE would have generated “<foo/>”.
Where this can cause pain is if you receive a message like: “<foo><bar></bar></foo>”
into your orchestration, and then do a series of assignments like:
xmlDocVariable = myMessage;
// xmlDocVariable2 initialized because xmlDocVariable is needed for other things...
xmlDocVariable2.LoadXml(xmlDocVariable.OuterXml);
myMessage2 = xmlDocVariable2;
At this point, myMessage2 is going to be the serialized representation of xmlDocVariable2.
By default, you will now get:
<foo>
..<bar>
..</bar>
</foo>
Notice you now have carriage returns, line feeds, and spaces (shown here as periods)
involved. Depending on how you now go after /foo/bar, this can be bad (i.e.
you won’t get empty content when you might expect it.) You can avoid this
behavior by doing:
xmlDocVariable2.LoadXml(xmlDocVariable.OuterXml);
xmlDocVariable2.PreserveWhitespace = true;
myMessage2 = xmlDocVariable2;
Thanks to Tomas and Carlos for
setting me straight on PreserveWhitespace – I was trying to set it before the
call to LoadXml, and this doesn’t work. Never a dull day in BizTalk land…
The documentation
for PreserveWhitespace is a little strange. This functionality would seem
to be better represented as parameters to Load/Save, rather than as a property…
“If PreserveWhitespace is true before Load or LoadXml is called, white
space nodes are preserved; otherwise, if this property is false, significant white
space is preserved, white space is not. If PreserveWhitespace is true before
Save is called, white space in the document is preserved in the output; otherwise,
if this property is false, XmlDocument auto-indents the output.”
by community-syndication | Jun 18, 2007 | BizTalk Community Blogs via Syndication
This past weekend our company did it’s first significant BizTalk application deployment into a production environment. I encountered a few issues along the way, and I thought I’d list the problem and resolution.
In order of annoyance to me (from least to greatest):
Transport does not have read/write privileges for receive location … We had […]
by community-syndication | Jun 18, 2007 | BizTalk Community Blogs via Syndication
It starts out by reviewing the WCF binding architecture, the various built-in binding classes and how to configure them. Then it shows you how to define custom bindings using the various binding element classesthat ship with the framework — it also shows you how to make your custom bindings easy to use via configuration. Enjoy.
by community-syndication | Jun 17, 2007 | BizTalk Community Blogs via Syndication
Currently I’m setting up a system and found an interesting ‘challenge’. After some
sweat and tears I stumbled upon this Microsoft article.
In the article it appears that running IIS 6.0 on a 64-bit box is cool. (obviously
or there’d be trouble)
It’s also cool to run 32-bit ASP.NET apps in 1.1/2.0
It is not cool to run a mix of
32- and 64-bit in the same IIS.
Thought I’d save you my pain!
by community-syndication | Jun 17, 2007 | BizTalk Community Blogs via Syndication
I had a great time time at the Auckland Web Meetup last week, I have been skimming through the comments… the fact that 120 people came along was really quite impressive.
The day of my presentation I thought hard about whether to do any slides or just straight in with the WPF and Silverlight demos. I chose to do 10 minutes of (wooly)slides (some of you will recognise them from my brightstar presentation)… talking to Matt from Cactuslab after the session he said I really only needed to show this slide to set the scene.
I was kicking myself because I ran out of time to show BackgroundMotion.com but if you are interested take a look here.
Glen Barnes will be posting a link to the video presentations from the night on his blog soon but in the mean time I thought I’d show you one of my demos from the night. In the demo I use Expression Blend 2 (26mb), notepad (you could alternatively use TextEdit and this SDK if you are a Mac user), together to create video with reflection. I have extended that demo to include Silverlight Streaming so you can see the result of the demo hosted on the web on us.
Here is the source code for the project (6kb) minus the video… or with video (12 MB).
Sit back and enjoy the 7 1/2 minute ride 😉
Double click on the video to play full screen, once full screen single click to “unpause”
function CreateSilverlight(){Sys.Silverlight.createHostedObjectEx({source: “streaming:/15799/GearsTutorial”,parentElement: GearsTutorialWrapper});}
var GearsTutorialWrapper = document.getElementById(“GearsTutorialWrapper”);
CreateSilverlight();
And the Silverlight application that we create in the presentation is online here.
On the topic of fullscreen I see that Robert has commented on this as a security concern. I talked about this with Robert on the night but I didn’t specifically call out that a Silverlight control can only enable full-screen mode in response to a set of user-initiated actions and that when in full-screen mode, with no shell showing, you can use the mouse on the canvas provided by the application, but can’t enter keystrokes with the keyboard. IMO this reduces the risk for the user considerably.
Juha also posted about the event on the computerworld site. Actually Rob O’Neill (editor of computerworld) came up to me after my presentation and said he needed to take back what he wrote last week about Microsoft not innovating 😉
As for Robert’s presentation I do want to make a couple of comments. I kept my mouth shut on the night but I am a little concerned about a few of the things that were presented in FF3 that could become blockers to this stuff being implemented in IE vNext.
The <CANVAS> tag… yes this looked great implemented but I’m concerned by this article in Wikipedia…
“Intellectual property over canvas
On March 14, 2007, WebKit developer Dave Hyatt forwarded an email from Apple’s Senior Patent Counsel, Helena Plotka Workman[7], which stated that Apple reserved all intellectual property rights relative to WHATWG’s Web Applications 1.0 Working Draft, dated March 24, 2005, Section 10.1, entitled “Graphics: The bitmap canvas” (sic)[8], but left the door open to licensing the patents should the specification be transferred to a standards body with a formal patent policy. This caused considerable discussion among web developers, and raised questions concerning the WHATWG‘s lack of a policy on patents in comparison to the W3C‘s explicit favoring of royalty-free licenses.”
In general, we’re all for standards and are working hard in the standards bodies now. However, some of the key players in this game don’t appear to have the same IP concerns (or attendant liability risk) that we do.
According to this guy… Ogg (the open source video format that Chris presented) still carries potential risks, because there is no guarantee that it doesn’t infringe someone’s patents. I’m sure we are all aware of what is happening with MP3 even though in many cases it was correctly licensed!
If you missed out on my presentation last week and want to see Silverlight in action come along to the Auckland .NET user group meeting this Wednesday night at Microsoft. I’ll have some training DVD’s and copies of Visual Studio “orcas” beta 1 to give away.
Hope to see you then.
This posting is provided “AS IS” with no warranties, and confers no rights.