drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::ResourceContext Class Reference

#include <resource_context.h>

Collaboration diagram for drizzled::ResourceContext:
[legend]

Public Member Functions

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

Private Attributes

plugin::MonitoredInTransaction * monitored
plugin::XaResourceManager * xa_resource_manager
plugin::TransactionalStorageEngine * trx_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.

Constructor & Destructor Documentation

◆ ResourceContext()

drizzled::ResourceContext::ResourceContext ( )
inline

Definition at line 45 of file resource_context.h.

Member Function Documentation

◆ coalesceWith()

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.

◆ getMonitored()

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.

◆ getTransactionalStorageEngine()

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.

◆ getXaResourceManager()

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.

◆ hasModifiedData()

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.

◆ isStarted()

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.

◆ markModifiedData()

void drizzled::ResourceContext::markModifiedData ( )

Marks that the underlying resource manager has modified data state.

Definition at line 39 of file resource_context.cc.

◆ reset()

void drizzled::ResourceContext::reset ( )

Clear, prepare for reuse.

Definition at line 31 of file resource_context.cc.

◆ setMonitored()

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.

◆ setTransactionalStorageEngine()

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.

◆ setXaResourceManager()

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.

Member Data Documentation

◆ modified_data

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.

◆ monitored

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

A descriptor of the monitored resource

Definition at line 133 of file resource_context.h.

◆ trx_storage_engine

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.

◆ xa_resource_manager

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.


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