Tuesday, November 25, 2008

Security Warning in InfoPath

Disable the Internet Explorer security risk dialog box:
· From Internet Explorer, choose Internet Options from the Tools menu.
· On the Security tab of the Internet Options dialog box, select the Local Intranet Web Content Zone and then click Custom Level.
· Locate the Miscellaneous/Access Data Sources Across Domains setting, and then select Enable, as shown in Figure 2.
· Click OK, and then click Yes to the warning dialog box that appears.
· Click OK to close the Internet Options dialog box.

These Internet Explorer security options are per machine settings. If you choose to use this solution as part of deployment, you will need to follow the above steps on each machine that will be using your form.

How to add custom menus in InfoPath form

Add the following code in manifest.xsf

<xsf:menuarea name="msoStructuralEditingContextMenu">
<xsf:button name="TestMenu" caption="Test Menu" xmltoedit="field1" showif="immediate">lt;/xsf:button>
</xsf:menuArea>

A new custom menu "Test Menu" will be added. xmltoedit specifies the field for which this menu must appear.

In FormCode.vb, add the event handler for the menu as follows:
< infopatheventhandler(matchpath:="testmenu",> _
Public Sub TestMenu_OnClick(ByVal e As DocActionEvent)

BizTalk Server Host throttling

We faced a performance issue in BizTalk some time back. As a result of bulk operations due to financial closing at year-end, a lot of messages were in a dehydrated state and the processing was too slow. As usual Googling led to Performance tips and tricks provided by Microsoft. The first step in such investigations, as rightly pointed out, is obviously identifying the bottleneck, which in our case was the BizTalk Tier. To identify bottlenecks, we monitored a few performance counters. As the article suggests, we started with Message Delivery Throttling State and the Message Publishing Throttling State performance counters and immediately we caught hold of the culprit! Host Throttling Performance Counters gives a complete listing of all performance counters that can be monitored to identify such bottlenecks.

Message Publishing Throttling State was 4 which means Throttling due to process memory pressure. The possible values are as follows:
0: Not throttling
2: Throttling due to imbalanced message publishing rate (input rate exceeds output rate)
4: Throttling due to process memory pressure
5: Throttling due to system memory pressure
6: Throttling due to database growth
8: Throttling due to high session count
9: Throttling due to high thread count
11: Throttling due to user override on publishing

I will discuss the measures taken to overcome this issue later in this article, but, what we first need to look at is, what is host throttling. This is what Microsoft says:
To manage the use of resources by a host instance process, BizTalk Server utilizes an adjustable throttling mechanism that governs the flow and processing of messages through a host instance. The throttling mechanism moderates the workload of the host instance to ensure that the workload does not exceed the capacity of the host instance or any downstream host instances. The host throttling mechanism also detects when available resources are being underutilized. It helps to ensure that the system operates at an optimal and sustainable level. This mechanism continually monitors for a throttling condition, calculates the severity of the throttling condition, and applies host throttling progressively depending on the calculated severity. The throttling mechanism is self tuning and the default configuration options are suitable for the majority of BizTalk Server 2006 processing scenarios. For example, if inbound throttling is applied to a receive adapter then the receive adapter may stop receiving messages until the throttling condition is mitigated. For details, read What Is Host Throttling? Host throttling configuration parameters are set on a per host basis in the BizTalk Server Administration console.

How BizTalk Server Implements Host Throttling provides a mitigation strategy for each of the above throttling conditions. Since throttling was due to process memory pressure, we increased Process memory usage threshold for the host, as suggested in the article. By default, it is 25%. What this really means, is that, a throttling condition will be triggered when process memory usage exceeds 25% of the total available process memory (The maximum available process memory is capped at an address space size of 2 GB) i.e., 500MB. We increased it to 35%, which means that, throttling condition will be triggered only when process memory usage exceeds around 700 MB. In our case, the actual process memory usage was 630MB, which is more that 500MB, which resulted in a throttling condition. Increasing the threshold resulted in mitigation of throttling condition and the messages were immediately proccessed.
This also meant that, with increasing number of BizTalk applications, one host instance would not be enough and such issues would reoccur. This prompted us to introduce an additional host instance. Now we have two host instances, one that is used for real-time applications and another, that is used for scheduled applications.

Tuesday, May 6, 2008

Connection Timeout in InfoPath 2003

To overcome the connection timeout issue in InfoPath 2003, specify Timeout for QueryAdapter as given below:
thisXDocument.QueryAdapter.Timeout = 100
By default it is 30 seconds.

Copying a wiki page in Sharepoint

Go to the wiki page on the source site in one browser tab / window. Now there's two ways to continue:
If you see two toolbars, as in this picture

click the text box below to activate the toolbar, then click on the last icon on the first line: . This should open a new window, containing the wiki markup. Press Ctrl-a (select all) followed by Ctrl-c (copy).
If you don't see any toolbars, you can just copy the contents of the big text box (Click on it, then press Ctrl-a [select all] followed by Ctrl-c [copy]).

Go to the page you want to overwrite (create one if necessary) in the destination site the same way as above, but press Ctrl-a [select all] followed by Ctrl-v [paste] (instead of Ctrl-c as above)

Press OK in the destination page to save changes. You have now replaced the contents in the destination wiki page with that of the source page.