Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
<[%$TOPIC/ms439190_en-us_office_15_4_0_0_0_0%]("611573DB-FDED-471e-9249-D899956FBD3F")> _ <[%$TOPIC/ms439190_en-us_office_15_4_0_0_0_1%]([%$TOPIC/ms439190_en-us_office_15_4_0_0_0_2%].LinkDemand, ObjectModel := True)> _ <[%$TOPIC/ms439190_en-us_office_15_4_0_0_0_3%]([%$TOPIC/ms439190_en-us_office_15_4_0_0_0_4%].InheritanceDemand, ObjectModel := True)> _ Public Class SPWorkItemJobDefinition _ Inherits [%$TOPIC/ms439190_en-us_office_15_4_0_0_0_5%]
Dim instance As SPWorkItemJobDefinition
[[%$TOPIC/ms439190_en-us_office_15_4_0_2_0_0%]("611573DB-FDED-471e-9249-D899956FBD3F")] [[%$TOPIC/ms439190_en-us_office_15_4_0_2_0_1%]([%$TOPIC/ms439190_en-us_office_15_4_0_2_0_2%].LinkDemand, ObjectModel = true)] [[%$TOPIC/ms439190_en-us_office_15_4_0_2_0_3%]([%$TOPIC/ms439190_en-us_office_15_4_0_2_0_4%].InheritanceDemand, ObjectModel = true)] public class SPWorkItemJobDefinition : [%$TOPIC/ms439190_en-us_office_15_4_0_2_0_5%]
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.