다음을 통해 공유


BeginTrans (MDStore Interface)

[!참고]

  이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

The BeginTrans method of the MDStore interface initiates a transaction on the Analysis server database.

Applies To:clsDatabase

구문

object.BeginTrans    

매개 변수

  • object
    The Database object to which changes are to be applied.

주의

Transactions group the processing of objects on the Analysis server by using the Process method for Database, Cube, Partition, or Dimension objects after executing the BeginTrans method. Processing actions within a transaction are not initiated on the server until you execute the CommitTrans method. You can use the Rollback method to void a transaction and leave the state of the objects on the server in the same condition they were in before the transaction was initiated. The processing of all objects on which you execute the Process method within the same transaction is completed as a single atomic operation. All of the specified processing is completed if the transaction completes successfully; none of it is completed if you roll back the transaction or if it terminates abnormally.

If you invoke a Process method on an object without first explicitly beginning a transaction using the BeginTrans method, Decision Support Objects (DSO) creates a single transaction for you so that the object you are processing is always processed inside a transaction.

The following code example begins a transaction on the FoodMart 2000 database, processes the Sales and Budget cubes, and commits the transaction:

    Dim dsoServer As New DSO.Server
    Dim dsoDB As DSO.MDStore
    Dim dsoCube As DSO.MDStore

    ' Connect to the local Analysis server.
    dsoServer.Connect "LocalHost"
    
    ' Open the FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")
    
    ' Begin a transaction on the database.
    dsoDB.BeginTrans
    
    ' Create a reference to the Sales cube.
    Set dsoCube = dsoDB.MDStores("Sales")
    
    ' Process the cube, refreshing data.
    dsoCube.Process processRefreshData
    
    'Creae a reference to the Budget cube.
    Set dsoCube = dsoDB.MDStores("Budget")
    
    ' Process the cube completely.
    dsoCube.Process processFull
    
    ' Commit the transaction.
    dsoDB.CommitTrans