Transaction Class Reference

Inherited by JiniTransaction, and LocalTransaction.

List of all members.


Detailed Description

This CPP class represents a transaction within the OpenSpaces environment.

Encapsulates a transaction in the space.

All space operations require a transaction argument.

There are 2 types of transactions (that correspond to the types of Transaction Manager):

A transaction can be obtained in one of the following ways: Once a transaction is created it can be used with any of the space operations until it is either committed or aborted.

Note:
All space operations can also accept Null Transaction (NULL_TX), meaning no transaction is used.
Sample usage:

Here is an example of using a transaction to perform a space operation:


 TransactionPtr txn = spaceProxy->getLocalTransaction();
 Message msg;
 msg.content = "Hello World";
 spaceProxy->write( &msg, txn, Lease::FOREVER );
 txn->commit();
 

Note:
Some space operations accept isolation level flags (ReadModifiers) that together with transactions control locking and blocking of objects in the space.
Author:
Irit Rosdeutscher
See also:
ITransactionManager, SpaceProxy, ReadModifiers

Public Member Functions

virtual void abort (long long waitForTime=MAX_TIMEOUT)=0
 Aborts the transaction.
virtual void commit (long long waitForTime=MAX_TIMEOUT)=0
 Commits the transaction.
virtual ~Transaction ()
 Destructor for a transaction object.

Constructor & Destructor Documentation

Transaction::~Transaction (  )  [virtual]

Destructor for a transaction object.

Performs cleanup.


Member Function Documentation

virtual void Transaction::abort ( long long  waitForTime = MAX_TIMEOUT  )  [pure virtual]

Aborts the transaction.

If waitForTime is positive then waiting for participants to be notified of the decision.

Parameters:
waitForTime - Time in milliseconds to wait until all participants are notified. Default is MAX_TIMEOUT.
Exceptions:
RemoteException - if a communication error occurs

virtual void Transaction::commit ( long long  waitForTime = MAX_TIMEOUT  )  [pure virtual]

Commits the transaction.

If waitForTime is positive then waiting for participants to be notified of the decision.

Parameters:
waitForTime - Time in milliseconds to wait until all participants are notified. Default is MAX_TIMEOUT.
Exceptions:
RemoteException - if a communication error occurs


Generated on Thu Jul 22 08:11:55 2010 for GigaSpaces XAP 10.2.1 C++ by  doxygen 1.5.3