Moss 2007 web enabled Infopath form timeout troubleshooting

This is an old problem but lastly i handle a case and fallowed below troubleshooting.

1) Check the InfoPath service timeout configuration. Central Administration -> (InforPath Form Services Section) Configure Infopath forms service.
Check “Data Connection Timeouts” as milliseconds.

Check “Form Session State” Active session should be terminated after option

2) Check your web application timeouts from IIS by open IIS mmc and right click your sharepoint site.

3) Check your sharepoint web.config file for HttpRuntime.executionTimeout value :

<httpruntime maxRequestLength=”51200″ executionTimeout=”7200” />

Optional Int32 attribute.
Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.The default is 110. In the .NET Framework 1.0 and 1.1, the default is 90 seconds.

 

Sharepoint 2007 & 2010 Execution Timeout

Sometimes your code needs  time to execute and sharepoint throw an error about Timeout .  here is the solution:

Add this config line to your web.config.

<httpRuntime maxRequestLength=”51200″ executionTimeout=”1200″/>

MSDN say for executionTimeout : Optional Int32 attribute.Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET.

This time-out applies only if the debug attribute in the compilation element is False. If the debug attribute is True, to help avoiding application shut-down while you are debugging, do not set this time-out to a large value.

The default is 110 seconds. If you set executionTimeout 1200 means 20 minutes.

Here’s the complete syntax for this tag:

<httpRuntime executionTimeout=”seconds”
maxRequestLength=”kbytes”
minFreeThreads=”numberOfThreads”
minLocalRequestFreeThreads=”numberOfThreads”
appRequestQueueLimit=”numberOfRequests”
useFullyQualifiedRedirectUrl=”true|false”  />

This time-out applies only if the debug attribute in the compilation element is False. when set to “debug=true” mode, the runtime will ignore the timeout setting.

Important note: If you are working with application pages in Layouts folder you should change web.config of this folder not your application folder.

If you want to use this attribute for one page your config should be like this

<location path=”MyPages/TestPage.aspx”>
<system.web>
<httpRuntime
executionTimeout=”1200″
maxRequestLength=”51200″ />
</system.web>
</location>

Happy tips..

when CacheItemRemovedCallback is raised HttpContext.Current is null

CacheItemRemovedCallback shows users the value assigned to an item in the cache and then notifies them when the item is removed from the cache. It creates a RemovedCallback method, which uses the signature of the CacheItemRemovedCallback delegate, to notify users when the cache item is removed and uses theCacheItemRemovedReason enumeration to tell them why it was removed.But when you try to use cache with HttpContext.Current it encounter an object not set reference error.

Here is the solution.

Use :HttpRuntime.Cache instead of HttpContext.Current.Cache object

Example::

 public static void DropUser(string key, object value, CacheItemRemovedReason reason)
        {
            List<string> OnlineUserAccounts = null;
            if (HttpRuntime.Cache[CACHE_KEY] != null)
            {
                OnlineUserAccounts = (List<string>)HttpRuntime.Cache[CACHE_KEY];
                if (OnlineUserAccounts.Contains(key))
                {
                    OnlineUserAccounts.Remove(key);
 
                    HttpRuntime.Cache[CACHE_KEY] = OnlineUserAccounts;
                }
            }
        }
 
Happy Codding.