Databases Reference
In-Depth Information
The syntax for these commands is simple:
<BeginTransaction/>
<CommitTransaction/>
<RollbackTransaction/>
When Analysis Services receives a
BeginTransaction
command, it checks whether there is
an existing
Transaction
object on the current session. If there isn't, Analysis Services
creates a new
Transaction
object and assigns it a unique identifier. If there is an existing
Transaction
object on the current session, Analysis Services increments the internal
counter for that
Transaction
object. The current version of Analysis Services doesn't
support nested transactions. All subsequent operations execute inside the transaction. A
user (or multiple users) working with different sessions don't see changes occurring inside
the transaction; the changes aren't visible until they are committed. After the transaction
is committed, users can see the updated objects.
You should call the
CommitTransaction
command as many times as you call the
BeginTransaction
command, before the
CommitTransaction
command commits the
changes. However, if the changes are to be rolled back, the
RollbackTransaction
command rolls back the changes no matter how many times
BeginTransaction
was called
before
RollbackTransaction
(as shown in Figure 26.3). If you try to roll back a transaction
before it starts, Analysis Services returns an error.
Server
Session
Session
Request
Request
Begin
Transaction
Begin
Transaction
Begin Transaction
Begin Transaction
Command 1
Command 1
Command 2
Command 2
Begin Transaction
Begin Transaction
Command 3
Command 3
Command 4
Command 4
Commit Transaction
Rollback
Transaction
Commit
Transaction
Command 5
Command 6
Commit
Transaction
Commit Transaction
FIGURE 26.3
If all commands execute successfully, they are committed; if one command in
the transaction fails, they all roll back.
Search WWH ::
Custom Search