SharePoint – Unexpected error occurred in method GetObject, usage SPViewStateCache

In case of SharePoint web part depends heavily in Viewstate to store large data or request, you may face an issue in SharePoint that sometime data is not saved and if you check the SharePoint logs you will find the below error:

Unexpected Unexpected error occurred in method ‘GetObject‘ , usage ‘SPViewStateCache‘ – Exception ‘Microsoft.ApplicationServer.Caching.DataCacheException:

Untitled.png

It seems SharePoint try to cache the request using distributed cache service and this service has default limitations (20 seconds).

To fix the above issue, try to increase the RequestTimeout as the below PowerShell script:

$ViewStateCache = Get-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache
$ViewStateCache.RequestTimeout = 1000
Set-SPDistributedCacheClientSetting -ContainerType DistributedViewStateCache -DistributedCacheClientSettings $ViewStateCache

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s