Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
'Declaration <GuidAttribute("611573DB-FDED-471e-9249-D899956FBD3F")> _ <SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _ <SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _ Public Class SPWorkItemJobDefinition _ Inherits SPPausableJobDefinition 'Usage Dim instance As SPWorkItemJobDefinition
[GuidAttribute("611573DB-FDED-471e-9249-D899956FBD3F")] [SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)] [SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)] public class SPWorkItemJobDefinition : SPPausableJobDefinition
This class works closely with the SPWorkItem and SPWorkItemCollection classes. You should use the collection class, to which the SPSite object has access, to add work items to the processing queue. When your work-item timer job executes, it pulls work items off the queue in batches that are based on the work item type (Type). Work items are delivered to the ProcessWorkItems method in cluster ordering, which is specified by using the BatchId.
If the lock type is ContentDatabase, your timer job locks an entire content database (SPContentDatabase instance) and processes all of the runnable work items in that database (and its site collections) before moving to the next one. In most cases, this is a self-limiting method.
If the lock type is None, you can have multiple front-end computers working against the specified timer job, which provides much greater performance. When you are not using locks on the timer job, the work items themselves (which are self-locking) handle work-item locking. Lock type None is the default value.
LockType value Job provides locks at the level of the timer job and prevents the job from running on more than one computer at a time.
Generally, unless you have a specific and compelling reason to lock an entire content database, it is recommended that you do not use locks (that is, use the default, None).
The difference between the two variants of the ProcessWorkItems method in that the second provides a Boolean parameter, continueProcessing. On job definitions created using this constructor, when the lock type is None, work items continue processing until no work items remain.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.