2
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
4
* Copyright (C) 2008 Sun Microsystems
5
* Copyright (c) 2010 Jay Pipes <jaypipes@gmail.com>
6
7
* This program is free software; you can redistribute it and/or modify
7
8
* it under the terms of the GNU General Public License as published by
31
class MonitoredInTransaction;
32
class TransactionalStorageEngine;
33
class XaResourceManager;
34
37
* Either statement transaction or normal transaction - related
35
* session-specific storage engine data.
38
* session-specific resource manager data state.
37
* If a storage engine participates in a statement/transaction,
40
* If a resource manager participates in a statement/transaction,
38
41
* an instance of this class is present in
39
42
* session->transaction.{stmt|all}.resource_contexts.
41
* When it's time to commit or rollback, each element of ha_list
42
* is used to access resource manager's prepare()/commit()/rollback()
44
* When it's time to commit or rollback, each resource context
45
* is used to access the resource manager's prepare()/commit()/rollback()
43
46
* methods, and also to evaluate if a full two phase commit is
81
86
void coalesceWith(const ResourceContext *stmt_trx);
84
* Returns the underlying resource manager
89
* Returns the underlying descriptor for the resource
85
90
* this context tracks.
87
drizzled::plugin::StorageEngine *getResource() const
93
* Sets the underlying resource
95
void setResource(drizzled::plugin::StorageEngine *in_engine)
92
plugin::MonitoredInTransaction *getMonitored() const
98
* Sets the underlying descriptor for the resource
100
void setMonitored(plugin::MonitoredInTransaction *in_monitored)
102
monitored= in_monitored;
106
* Returns the underlying transactional storage engine
107
* this context tracks or NULL if not SQL transactional capable.
109
plugin::TransactionalStorageEngine *getTransactionalStorageEngine() const
111
return trx_storage_engine;
115
* Sets the underlying transactional storage engine
117
void setTransactionalStorageEngine(plugin::TransactionalStorageEngine *in_trx_storage_engine)
119
trx_storage_engine= in_trx_storage_engine;
123
* Returns the underlying XA resource manager
124
* this context tracks or NULL if not XA capable.
126
plugin::XaResourceManager *getXaResourceManager() const
128
return xa_resource_manager;
132
* Sets the underlying xa resource manager
134
void setXaResourceManager(plugin::XaResourceManager *in_xa_resource_manager)
136
xa_resource_manager= in_xa_resource_manager;
101
Although a given ResourceContext instance is always used
102
for the same resource manager, 'resource' is not-NULL only when the
103
corresponding resource manager is a part of a transaction.
105
drizzled::plugin::StorageEngine *resource;
140
* A descriptor of the monitored resource
142
plugin::MonitoredInTransaction *monitored;
144
* The XA resource manager or NULL if not XA capable.
146
plugin::XaResourceManager *xa_resource_manager;
148
* The transactional storage engine or NULL if not SQL transaction capable.
150
plugin::TransactionalStorageEngine *trx_storage_engine;
107
152
* Whether the underlying resource manager has changed
108
153
* some data state.