#include <monitored_in_transaction.h>
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 |
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.
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.
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.
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.
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.
Referenced by drizzled::TransactionServices::commitPhaseOne(), drizzled::TransactionServices::registerResourceForStatement(), drizzled::TransactionServices::registerResourceForTransaction(), and drizzled::TransactionServices::setSavepoint().
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.
Referenced by drizzled::TransactionServices::commitPhaseOne(), drizzled::TransactionServices::commitTransaction(), drizzled::TransactionServices::registerResourceForStatement(), and drizzled::TransactionServices::registerResourceForTransaction().
size_t drizzled::plugin::MonitoredInTransaction::id [private] |
The ID or "slot" of the plugin.
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.