GlobalObjects
Loading...
Searching...
No Matches
glo::TransactionManager::CommunicatorTransactionStack Class Reference

The transaction stack of a client communicator for a database. More...

#include <GloTransactionManager.h>

Public Member Functions

 CommunicatorTransactionStack (Communicator *pCommunicator)
 
 ~CommunicatorTransactionStack ()
 
bool abortTransaction (std::list< TransactionBase * > &rAbortedTransactionStepList)
 
void beginTransaction ()
 
bool commitTransaction ()
 
CommunicatorgetCommunicator ()
 
std::list< TransactionManager::TransactionBase * > & getTransactionStack ()
 
int setTransactionStep (NUM_PTR &nNewTrxStepAddr, EnStoreDelete eAction, Record *pActionRecord)
 

Protected Member Functions

 CommunicatorTransactionStack ()
 

Private Member Functions

 CommunicatorTransactionStack (const CommunicatorTransactionStack &)
 
TransactionManager::CommunicatorTransactionStackoperator= (const CommunicatorTransactionStack &)
 

Private Attributes

int m_iCurrentTransactionPoint
 
Communicatorm_pCommunicator
 
std::list< TransactionBase * > m_TransactionStack
 

Detailed Description

The transaction stack of a client communicator for a database.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ CommunicatorTransactionStack() [1/3]

glo::TransactionManager::CommunicatorTransactionStack::CommunicatorTransactionStack ( )
protected

The default constructor is not available.

◆ CommunicatorTransactionStack() [2/3]

glo::TransactionManager::CommunicatorTransactionStack::CommunicatorTransactionStack ( Communicator * pCommunicator)

Constructor with parameter passing.

Parameters
[in]pCommunicatorThe client communicator that starts the transaction.
Exceptions
eut::ErrorNExceptionAn exception is thrown if an error occurs.

◆ ~CommunicatorTransactionStack()

glo::TransactionManager::CommunicatorTransactionStack::~CommunicatorTransactionStack ( )

Destructor, the transaction is aborted and the memory is cleared.

◆ CommunicatorTransactionStack() [3/3]

glo::TransactionManager::CommunicatorTransactionStack::CommunicatorTransactionStack ( const CommunicatorTransactionStack & )
private

The copy constructor is not available.

Member Function Documentation

◆ abortTransaction()

bool glo::TransactionManager::CommunicatorTransactionStack::abortTransaction ( std::list< TransactionBase * > & rAbortedTransactionStepList)

The transaction stack will be reduced to the TransactionPoint with the current value from m_iCurrentTransactionPoint.

Then the value in m_iCurrentTransactionPoint is decremented. If this is 0,true is returned.

Parameters
[in,out]rAbortedTransactionStepListIn this list the rejected TransactionSteps are delivered (must be amongst other things released in the LockManager).
Returns
If true is delivered, the processing of the TransactionSteps can be rejected, the transaction stack is then empty.
Attention
The objects in the delivered list must be removed from memory by the calling instance.

◆ beginTransaction()

void glo::TransactionManager::CommunicatorTransactionStack::beginTransaction ( )

Starts a new transaction by placing a new TransactionPoint on the transaction stack.

◆ commitTransaction()

bool glo::TransactionManager::CommunicatorTransactionStack::commitTransaction ( )

The value in m_iCurrentTransactionPoint is decremented. If this is 0, true is returned.

Returns
If true is returned, the TransactionSteps can be processed.

◆ getCommunicator()

Communicator * glo::TransactionManager::CommunicatorTransactionStack::getCommunicator ( )

Returns a pointer to the client communicator that started the transaction.

Returns
See above.

◆ getTransactionStack()

std::list< TransactionManager::TransactionBase * > & glo::TransactionManager::CommunicatorTransactionStack::getTransactionStack ( )

Returns a reference to the transaction stack.

Returns
See above.

◆ operator=()

TransactionManager::CommunicatorTransactionStack & glo::TransactionManager::CommunicatorTransactionStack::operator= ( const CommunicatorTransactionStack & )
private

The assignment operator is not available.

◆ setTransactionStep()

int glo::TransactionManager::CommunicatorTransactionStack::setTransactionStep ( NUM_PTR & nNewTrxStepAddr,
EnStoreDelete eAction,
Record * pActionRecord )

Generates a TransactionStep and places it on the transaction stack.

Parameters
[in,out]nNewTrxStepAddrThe address of the created TransactionStep to manage indexes (see also IndexPool::ObjectStrIndex::m_ReservedIndexMultiMap).
[in]eActionThe action how to handle the record; save or delete.
[in]pActionRecordThe record to be saved or deleted. The record is copied and not 'remembert'.
Returns
A return value < 0 indicates an error.

Member Data Documentation

◆ m_iCurrentTransactionPoint

int glo::TransactionManager::CommunicatorTransactionStack::m_iCurrentTransactionPoint
private

The current counter of the last TransactionPoint.

◆ m_pCommunicator

Communicator* glo::TransactionManager::CommunicatorTransactionStack::m_pCommunicator
private

The client communicator that started the transaction.

◆ m_TransactionStack

std::list<TransactionBase *> glo::TransactionManager::CommunicatorTransactionStack::m_TransactionStack
private

The list of individual objects of type TransactionPoint and TransactionStep.


The documentation for this class was generated from the following file: