Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 3 Performing Basic TIBCO ActiveSpaces Tasks : Using Transactions

Using Transactions
ActiveSpaces supports transactions to keep data consistent, even in cases of system failure. This section describes how transactions work in ActiveSpaces.
Creating and Committing or Rolling Back Transactions
Since in ActiveSpaces transactions can span operations on more than one space, users need to specify the start and the end of a transaction using the metaspace’s beginTransaction, commit, or rollback methods. A transaction is associated with the thread that created it: at the end of the transaction all of the space operations invoked by that thread will be either committed (if none of those space operations failed) or rolled back (if one of those operations failed), according to the method invoked. In other words, the prepare phase of the transaction is the invocation of operations on a space by a thread that has invoked beginTransaction first.
Obviously, only space operations that modify the data stored in a space are affected by the outcome of the transaction, but a get operation within a transaction will always return the uncommitted version of the tuples that may have been modified in that transaction.
Space Operation Options
Many space operations can be combined with various options. Options can be used to optimize performance of the space operations, by either combining two operations together or indicating whether the return value is unwanted.
Most operations for example can be combined with a lock or an unlock options. For example to simultaneously update the value and unlock a record you can pass the unlock option to your put operation. And if you do not care about the return of the put operation, you can specify the forget option.

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved