Quantcast
Channel: Developing Apps for SharePoint 2013 forum
Viewing all articles
Browse latest Browse all 8089

How to correctly handle CSOM time outs?

$
0
0

Hi,

when working with SharePoint 2013 / Online and CSOM how should time outs be handled correctly? For example when writing the following code:

using(ClientContext context = new ClientContext("https://mysharepoint-server/sites/somesite"))
{
	context.RequestTimeout = 1000 * 60 * 3; // 3min time out
	try
	{
		Web web = context.Site.RootWeb;
		List list = web.Lists.GetByTitle("SomeList");
		web.Context.Load(list);
		web.Context.ExecuteQuery();
		return list;
	}
	catch(Exception ex)
	{
		// Lets assume the exception was caused by a time out of the request
		log.WarnFormat("List not available.");

		// Is it sufficient here to only ExecuteQuery() again, or must Load() calls the recalled also?
		//web.Context.Load(list);
		//web.Context.ExecuteQuery();
	}
}

My question is, if I only have to re-call ExecuteQuery() or are re-calls of all previous Load() calls are required as well.


Viewing all articles
Browse latest Browse all 8089

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>