Monday, March 9, 2009

SharePoint uses action states in SPObjectStatus

An action state is a state that indicates that an action is being performed.  The SPObjectStatus used by the SPPersistedObject.Status has three such states Provisioning, Unprovisioning, and Upgrading this allows SPPersistedObjects to undergo long running operations.  Here is a quick summary of all the states:

Name

Meaning

Details

Disabled

OFF

New or fully removed object

Online

ON

Object fully setup

Provisioning

Action State

Moving to ON

Unprovisioning

Action State

Moving to OFF

Upgrading

Action State

Changing object versions

Offline

FAILED

Your dead

One of the major misconceptions with new SharePoint developers is that ON and OFF are really Online and Offline, but they are not. ON and OFF are represented by Online and Disabled.  Offline has the same meaning it does in SQLServer. Your object is dead beyond use.  This is data corruption, hardware failure, network failure, etc.

SharePoint maps the Provisioning and Unprovisioning states differently depending on the object.  Here are some examples:

Object

Provisioning

Unprovisioning

SPWindowsServerInstance

Starting

Stopping

SPSolution

Deploying

Retracting

SPDatabase

Creating

Dropping

It is best practice to code any custom SPPersistedObjects to set the Provisioning and Unprovisioning action states correctly.  Particularly if your Provision and Unprovision methods are long running.

No comments:

Post a Comment