Skip to content

Short-term and long-term check-out in SharePoint

November 16, 2010

Actually, it has never been clear for me that there are two different types of check-out in SharePoint: long-term and short-term check-out.

What we generally call check-out is the long-term one. The user goes to the document library checks out the file works on it and then cheks it in whenever feels like to. However there is also an automatic short-term checkout in case the document library is configured in a way that check-out is not required for document modification and a user opens a document for editing. Then the Office client puts a lock on the file so that won’t be editable for other users. This lock is kept alive while the file is being edited but released automatically when the file is closed or Office crashes.

There is no way on the SharePoint UI to override the sort-term checkout. From code, it is possible to use the SPFile.CheckOutStatus property which is a SPFile.SPCheckOutStatus enum with the following values:

None Specifies that the file is not checked out.
ShortTerm Specifies that the file has been opened by a user and is locked for editing. A short-term check-out, or file-locking, has effect only while the application renews the lock.
LongTerm Specifies that the file is check outed out for a long term.
LongTermOffline Specifies that the file is checked out offline.

In SharePoint 2010 this is obsolete. Instead there is an enum called SPFile.SPCheckOutType for the same purpose.

There is a practical example here: http://msdn.microsoft.com/en-us/library/cc664707(office.12).aspx

Advertisements

From → MOSS 2007, WSS 3.0

Leave a Comment

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: