77
86
* This method properly sets the is_active member variable.
79
88
void evaluateActivePlugins();
90
* Helper method which returns the active Transaction message
91
* for the supplied Session. If one is not found, a new Transaction
92
* message is allocated, initialized, and returned.
94
* @param The session processing the transaction
96
drizzled::message::Transaction *getActiveTransaction(Session *in_session) const;
81
98
* Helper method which attaches a transaction context
82
* the supplied command based on the supplied Session's
83
* transaction information.
85
void setCommandTransactionContext(drizzled::message::Command &in_command, Session *in_session) const;
99
* the supplied transaction based on the supplied Session's
100
* transaction information. This method also ensure the
101
* transaction message is attached properly to the Session object
103
* @param The transaction message to initialize
104
* @param The Session processing this transaction
106
void initTransaction(drizzled::message::Transaction &in_command, Session *in_session) const;
108
* Helper method which finalizes data members for the
109
* supplied transaction's context.
111
* @param The transaction message to finalize
112
* @param The Session processing this transaction
114
void finalizeTransaction(drizzled::message::Transaction &in_command, Session *in_session) const;
116
* Helper method which deletes transaction memory and
117
* unsets Session's transaction and statement messages.
119
void cleanupTransaction(message::Transaction *in_transaction,
120
Session *in_session) const;
122
* Helper method which initializes a Statement message
124
* @param The statement to initialize
125
* @param The type of the statement
126
* @param The session processing this statement
128
void initStatement(drizzled::message::Statement &statement,
129
drizzled::message::Statement::Type in_type,
130
Session *in_session) const;
132
* Helper method which returns an initialized Statement
133
* message for methods doing insertion of data.
135
* @param[in] Pointer to the Session doing the processing
136
* @param[in] Pointer to the Table object being inserted into
138
message::Statement &getInsertStatement(Session *in_session,
139
Table *in_table) const;
142
* Helper method which initializes the header message for
145
* @param[inout] Statement message container to modify
146
* @param[in] Pointer to the Session doing the processing
147
* @param[in] Pointer to the Table being inserted into
149
void setInsertHeader(message::Statement &statement,
151
Table *in_table) const;
153
* Helper method which returns an initialized Statement
154
* message for methods doing updates of data.
156
* @param[in] Pointer to the Session doing the processing
157
* @param[in] Pointer to the Table object being updated
158
* @param[in] Pointer to the old data in the record
159
* @param[in] Pointer to the new data in the record
161
message::Statement &getUpdateStatement(Session *in_session,
163
const unsigned char *old_record,
164
const unsigned char *new_record) const;
166
* Helper method which initializes the header message for
169
* @param[inout] Statement message container to modify
170
* @param[in] Pointer to the Session doing the processing
171
* @param[in] Pointer to the Table being updated
172
* @param[in] Pointer to the old data in the record
173
* @param[in] Pointer to the new data in the record
175
void setUpdateHeader(message::Statement &statement,
178
const unsigned char *old_record,
179
const unsigned char *new_record) const;
181
* Helper method which returns an initialized Statement
182
* message for methods doing deletion of data.
184
* @param[in] Pointer to the Session doing the processing
185
* @param[in] Pointer to the Table object being deleted from
187
message::Statement &getDeleteStatement(Session *in_session,
188
Table *in_table) const;
191
* Helper method which initializes the header message for
194
* @param[inout] Statement message container to modify
195
* @param[in] Pointer to the Session doing the processing
196
* @param[in] Pointer to the Table being deleted from
198
void setDeleteHeader(message::Statement &statement,
200
Table *in_table) const;
87
202
* Helper method which pushes a constructed message out
88
203
* to the registered replicator and applier plugins.
90
205
* @param Message to push out
92
void push(drizzled::message::Command &to_push);
207
void push(drizzled::message::Transaction &to_push);
119
234
* @param Pointer to a replicator to attach/register
121
void attachReplicator(drizzled::plugin::CommandReplicator *in_replicator);
236
void attachReplicator(drizzled::plugin::TransactionReplicator *in_replicator);
123
238
* Detaches/unregisters a replicator with our internal
124
239
* collection of replicators.
126
241
* @param Pointer to the replicator to detach
128
void detachReplicator(drizzled::plugin::CommandReplicator *in_replicator);
243
void detachReplicator(drizzled::plugin::TransactionReplicator *in_replicator);
130
245
* Attaches a applier to our internal collection of
133
248
* @param Pointer to a applier to attach/register
135
void attachApplier(drizzled::plugin::CommandApplier *in_applier);
250
void attachApplier(drizzled::plugin::TransactionApplier *in_applier);
137
252
* Detaches/unregisters a applier with our internal
138
253
* collection of appliers.
140
255
* @param Pointer to the applier to detach
142
void detachApplier(drizzled::plugin::CommandApplier *in_applier);
257
void detachApplier(drizzled::plugin::TransactionApplier *in_applier);
144
* Creates a new StartTransaction GPB message and pushes
259
* Creates a new Transaction GPB message and attaches the message
260
* to the supplied session object.
264
* This method is called when a "normal" transaction -- i.e. an
265
* explicitly-started transaction from a client -- is started with
266
* BEGIN or START TRANSACTION.
147
268
* @param Pointer to the Session starting the transaction
149
void startTransaction(Session *in_session);
270
void startNormalTransaction(Session *in_session);
151
* Creates a new CommitTransaction GPB message and pushes
272
* Commits a normal transaction (see above) and pushes the
273
* transaction message out to the replicators.
154
275
* @param Pointer to the Session committing the transaction
156
void commitTransaction(Session *in_session);
277
void commitNormalTransaction(Session *in_session);
158
* Creates a new RollbackTransaction GPB message and pushes
279
* Marks the current active transaction message as being rolled
280
* back and pushes the transaction message out to replicators.
161
282
* @param Pointer to the Session committing the transaction
163
284
void rollbackTransaction(Session *in_session);
286
* Finalizes a Statement message and sets the Session's statement
289
* @param The statement to initialize
290
* @param The session processing this statement
292
void finalizeStatement(drizzled::message::Statement &statement,
293
Session *in_session) const;
165
295
* Creates a new InsertRecord GPB message and pushes it to