Drizzled Public API Documentation

drizzled::ResourceContext Class Reference

#include <resource_context.h>

Public Member Functions

void reset ()
 
void markModifiedData ()
 
bool hasModifiedData () const
 
bool isStarted () const
 
void coalesceWith (const ResourceContext *stmt_trx)
 
plugin::MonitoredInTransactiongetMonitored () const
 
void setMonitored (plugin::MonitoredInTransaction *in_monitored)
 
plugin::TransactionalStorageEnginegetTransactionalStorageEngine () const
 
void setTransactionalStorageEngine (plugin::TransactionalStorageEngine *in_trx_storage_engine)
 
plugin::XaResourceManagergetXaResourceManager () const
 
void setXaResourceManager (plugin::XaResourceManager *in_xa_resource_manager)
 

Private Attributes

plugin::MonitoredInTransactionmonitored
 
plugin::XaResourceManagerxa_resource_manager
 
plugin::TransactionalStorageEnginetrx_storage_engine
 
bool modified_data
 

Detailed Description

Either statement transaction or normal transaction - related session-specific resource manager data state.

If a resource manager participates in a statement/transaction, an instance of this class is present in session->transaction.{stmt|all}.resource_contexts.

When it's time to commit or rollback, each resource context is used to access the resource manager's prepare()/commit()/rollback() methods, and also to evaluate if a full two phase commit is necessary.

See also
General description of transaction handling in drizzled/transaction_services.cc.

Definition at line 42 of file resource_context.h.

Member Function Documentation

void drizzled::ResourceContext::coalesceWith ( const ResourceContext stmt_trx)

Mark this context as modifying data if the argument has also modified data

Definition at line 56 of file resource_context.cc.

References hasModifiedData().

plugin::MonitoredInTransaction* drizzled::ResourceContext::getMonitored ( ) const
inline

Returns the underlying descriptor for the resource this context tracks.

Definition at line 83 of file resource_context.h.

References monitored.

plugin::TransactionalStorageEngine* drizzled::ResourceContext::getTransactionalStorageEngine ( ) const
inline

Returns the underlying transactional storage engine this context tracks or NULL if not SQL transactional capable.

Definition at line 100 of file resource_context.h.

References trx_storage_engine.

plugin::XaResourceManager* drizzled::ResourceContext::getXaResourceManager ( ) const
inline

Returns the underlying XA resource manager this context tracks or NULL if not XA capable.

Definition at line 117 of file resource_context.h.

References xa_resource_manager.

bool drizzled::ResourceContext::hasModifiedData ( ) const

Returns true if the underlying resource manager has modified data state.

Definition at line 45 of file resource_context.cc.

Referenced by coalesceWith().

bool drizzled::ResourceContext::isStarted ( ) const

Returns true if the underlying resource manager has registered with the transaction manager for this transaction.

Definition at line 51 of file resource_context.cc.

Referenced by drizzled::TransactionServices::registerResourceForStatement(), drizzled::TransactionServices::registerResourceForTransaction(), and drizzled::Cursor::setTransactionReadWrite().

void drizzled::ResourceContext::markModifiedData ( )

Marks that the underlying resource manager has modified data state.

Definition at line 39 of file resource_context.cc.

Referenced by drizzled::Cursor::setTransactionReadWrite().

void drizzled::ResourceContext::reset ( void  )

Clear, prepare for reuse.

Definition at line 31 of file resource_context.cc.

void drizzled::ResourceContext::setMonitored ( plugin::MonitoredInTransaction in_monitored)
inline

Sets the underlying descriptor for the resource

Definition at line 91 of file resource_context.h.

References monitored.

Referenced by drizzled::TransactionServices::registerResourceForStatement(), and drizzled::TransactionServices::registerResourceForTransaction().

void drizzled::ResourceContext::setTransactionalStorageEngine ( plugin::TransactionalStorageEngine in_trx_storage_engine)
inline

Sets the underlying transactional storage engine

Definition at line 108 of file resource_context.h.

References trx_storage_engine.

Referenced by drizzled::TransactionServices::registerResourceForStatement(), and drizzled::TransactionServices::registerResourceForTransaction().

void drizzled::ResourceContext::setXaResourceManager ( plugin::XaResourceManager in_xa_resource_manager)
inline

Sets the underlying xa resource manager

Definition at line 125 of file resource_context.h.

References xa_resource_manager.

Referenced by drizzled::TransactionServices::registerResourceForStatement().

Member Data Documentation

bool drizzled::ResourceContext::modified_data
private

Whether the underlying resource manager has changed some data state.

Definition at line 146 of file resource_context.h.

plugin::MonitoredInTransaction* drizzled::ResourceContext::monitored
private

A descriptor of the monitored resource

Definition at line 133 of file resource_context.h.

Referenced by getMonitored(), and setMonitored().

plugin::TransactionalStorageEngine* drizzled::ResourceContext::trx_storage_engine
private

The transactional storage engine or NULL if not SQL transaction capable.

Definition at line 141 of file resource_context.h.

Referenced by getTransactionalStorageEngine(), and setTransactionalStorageEngine().

plugin::XaResourceManager* drizzled::ResourceContext::xa_resource_manager
private

The XA resource manager or NULL if not XA capable.

Definition at line 137 of file resource_context.h.

Referenced by getXaResourceManager(), and setXaResourceManager().


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