drizzle
C++ MySQL-protocol-compatible database server
Loading...
Searching...
No Matches
drizzled::plugin::MonitoredInTransaction Class Referenceabstract

#include <monitored_in_transaction.h>

Inheritance diagram for drizzled::plugin::MonitoredInTransaction:
[legend]

Public Member Functions

virtual bool participatesInSqlTransaction () const =0
virtual bool participatesInXaTransaction () const =0
virtual bool alwaysRegisterForXaTransaction () const =0
size_t getId () const

Private Attributes

size_t id

Detailed Description

An abstract interface class for those objects which are tracked by the TransactionServices component during operations in a transaction.

Note that both non-transactional plugin::StorageEngines, non-XA plugin::TransactionalStorageEngines, and plugin::XaResourceManager objects are all tracked by the transaction manager in TransactionServices.

Implementing classes should inherit publically from plugin::MonitoredInTransaction, as public inheritance means "is a" and is the appropriate use here since all implementing classes are monitored in a transaction...

Definition at line 48 of file monitored_in_transaction.h.

Constructor & Destructor Documentation

◆ MonitoredInTransaction()

drizzled::plugin::MonitoredInTransaction::MonitoredInTransaction ( )

Definition at line 32 of file monitored_in_transaction.cc.

◆ ~MonitoredInTransaction()

virtual drizzled::plugin::MonitoredInTransaction::~MonitoredInTransaction ( )
inlinevirtual

Definition at line 53 of file monitored_in_transaction.h.

Member Function Documentation

◆ alwaysRegisterForXaTransaction()

virtual bool drizzled::plugin::MonitoredInTransaction::alwaysRegisterForXaTransaction ( ) const
pure virtual

Returns true if the class should be registered for every XA transaction regardless of whether the class modifies the server's state.

Note

As an example, the XaTransactionApplier plugin class returns true for this virtual method. Even though it does not change the result of the transaction (it simply is logging the changes made by other resource managers), the applier plugin should be enlisted in all XA transactions in order to be able to rollback or recover its logging activity properly.

Implemented in drizzled::plugin::StorageEngine, drizzled::plugin::TransactionalStorageEngine, and drizzled::plugin::XaStorageEngine.

◆ getId()

size_t drizzled::plugin::MonitoredInTransaction::getId ( ) const
inline

Returns the "slot" or ID of the monitored resource

Definition at line 87 of file monitored_in_transaction.h.

◆ participatesInSqlTransaction()

virtual bool drizzled::plugin::MonitoredInTransaction::participatesInSqlTransaction ( ) const
pure virtual

Returns true if the class should participate in the SQL transaction.

Implemented in drizzled::plugin::StorageEngine, drizzled::plugin::TransactionalStorageEngine, and drizzled::plugin::XaStorageEngine.

◆ participatesInXaTransaction()

virtual bool drizzled::plugin::MonitoredInTransaction::participatesInXaTransaction ( ) const
pure virtual

Returns true if the class should participate in the XA transaction.

Implemented in drizzled::plugin::StorageEngine, drizzled::plugin::TransactionalStorageEngine, and drizzled::plugin::XaStorageEngine.

Member Data Documentation

◆ id

size_t drizzled::plugin::MonitoredInTransaction::id
private

The ID or "slot" of the plugin.

Todo

Maybe move this into plugin::Plugin? Only issue then is that all plugins would have a ha_data slot, when only a few actually need that. Maybe create a plugin::NeedsSessionData?

Definition at line 101 of file monitored_in_transaction.h.


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