Search code examples
.netsharepointoffice-interopinfopath

'Manually' unlock an InfoPath form in SharePoint


We have a solution in which we use SharePoint 2007 to 'store' InfoPath forms in a FormLibrary. We've created a .NET client application which uses InfoPaths FormControl to open and display the forms to the end-user.

When the application shuts down normally, we close() the FormControl and a HTTP 204 (Unlock) is sent to SharePoint, which probably releases a lock it put on the form in question. However, when the application doesn't shut down normally (eg a crash of some kind), we find that the form cannot be opened anymore because it is 'locked by another user'.

This lock isn't of the "normal" Check-out type btw!

How can I circumvent this issue, or how can I have the lock released?


Solution

  • MS recommends waiting 10 mins or rebooting the server.
    http://support.microsoft.com/kb/899709/en-us

    Sometimes (mostly) that won't work so try out this code.
    http://www.codeproject.com/Articles/93965/Force-SharePoint-Document-Unlocked-Checked-In