#include <resource_context.h>
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 |
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.
Definition at line 50 of file resource_context.h.
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 91 of file resource_context.h.
References monitored.
Referenced by drizzled::TransactionServices::commitPhaseOne(), drizzled::TransactionServices::commitTransaction(), and drizzled::TransactionServices::setSavepoint().
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 108 of file resource_context.h.
References trx_storage_engine.
Referenced by drizzled::TransactionServices::autocommitOrRollback(), drizzled::TransactionServices::commitPhaseOne(), and drizzled::TransactionServices::setSavepoint().
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 125 of file resource_context.h.
References xa_resource_manager.
Referenced by drizzled::TransactionServices::commitPhaseOne(), and drizzled::TransactionServices::commitTransaction().
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(), and drizzled::TransactionServices::commitTransaction().
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().
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.
Referenced by drizzled::TransactionServices::commitPhaseOne().
void drizzled::ResourceContext::setMonitored | ( | plugin::MonitoredInTransaction * | in_monitored | ) | [inline] |
Sets the underlying descriptor for the resource
Definition at line 99 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 116 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 133 of file resource_context.h.
References xa_resource_manager.
Referenced by drizzled::TransactionServices::registerResourceForStatement().
bool drizzled::ResourceContext::modified_data [private] |
Whether the underlying resource manager has changed some data state.
Definition at line 154 of file resource_context.h.
A descriptor of the monitored resource
Definition at line 141 of file resource_context.h.
Referenced by getMonitored(), and setMonitored().
The transactional storage engine or NULL if not SQL transaction capable.
Definition at line 149 of file resource_context.h.
Referenced by getTransactionalStorageEngine(), and setTransactionalStorageEngine().
The XA resource manager or NULL if not XA capable.
Definition at line 145 of file resource_context.h.
Referenced by getXaResourceManager(), and setXaResourceManager().