LockObject (Dimension Interface)

ObservaçãoObservação

  Esse recurso será removido na próxima versão do Microsoft SQL Server. Não utilize esse recurso em desenvolvimentos novos e modifique, assim que possível, os aplicativos que atualmente o utilizam.

The LockObject method of the Dimension interface locks an object to prevent multiple users from concurrently changing the object.

Applies To:clsDatabaseDimension

Sintaxe

object.LockObject(ByVal LockType As OlapLockTypes, ByVal LockDescription As String)

Comentários

  • object
    The Dimension object to lock.

  • LockType
    One of the enumerated constants of the OlapLockTypes enumeration. For more information, see OlapLockTypes.

  • LockDescription
    A string containing the description of the lock, available to other applications attempting to obtain a lock.

Comentários

This table explains how each value that can be specified in LockType affects a lock made on a dimension object.

Lock type

Description

olapLockRead

Applications can read the properties of the dimension object from the repository but cannot make changes until the lock is released (this includes the application that created the lock). This lock does not affect dependent objects of the dimension (data source objects).

olapLockWrite

The application that created the lock can modify the dimension object's properties and save them in the repository using the Update method. Other applications cannot read the properties of the object until the lock is released.

olapLockExtendedRead

The properties of the dimension object and all of its dependent objects can be read (but not changed or processed) by other applications until the lock is released. This lock is used to prevent processing of dependent objects of a locked object (for example, dimensions that are shared by multiple cubes).

olapLockProcess

This lock is similar to olapLockExtendedRead, except the dimension object's Process method can be called by the application that created the lock. Other applications can read (but cannot change) the object's properties while the lock is in effect.

Exemplo

The following example locks the Product dimension of the FoodMart 2000 database, completely reprocesses it, and then unlocks it so others can make changes:

    Dim dsoServer As New DSO.Server
    Dim dsoDB As DSO.MDStore
    Dim dsoDim As DSO.Dimension
    
    ' Connect to local Analysis server.
    dsoServer.Connect "LocalHost"
    
    ' Open FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")

    ' Open the Product dimension.
    Set dsoDim = dsoDB.Dimensions("Product")
    
    ' Lock the dimension for processing.
    dsoDim.LockObject olapLockProcess, "Locked for processing."
    
    ' Completely reprocess the dimension.
    dsoDim.Process processFull
    
    ' Once complete, unlock the dimension.
    dsoDim.UnlockObject
    
    ' Clean up.
    Set dsoDim = Nothing
    Set dsoDB = Nothing
    dsoServer.CloseServer
    Set dsoServer = Nothing

Consulte também

Referência