~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.h

  • Committer: Olaf van der Spek
  • Date: 2011-06-23 10:47:03 UTC
  • mto: This revision was merged to the branch mainline in revision 2348.
  • Revision ID: olafvdspek@gmail.com-20110623104703-hw93svu0vfgcqt9p
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
public:
45
45
  static const size_t DEFAULT_RECORD_SIZE= 100;
46
46
  
47
 
  TransactionServices();
48
 
 
49
 
  /**
50
 
   * Singleton method
51
 
   * Returns the singleton instance of TransactionServices
52
 
   */
53
 
  static inline TransactionServices &singleton()
54
 
  {
55
 
    static TransactionServices transaction_services;
56
 
    return transaction_services;
57
 
  }
58
 
 
59
47
  /**
60
48
   * Returns true if the transaction manager should construct
61
49
   * Transaction and Statement messages, false otherwise.
189
177
   * @param query Query string
190
178
   * @param schema Schema for the table affected by the raw SQL.
191
179
   */
192
 
  void rawStatement(Session&, const std::string &query, const std::string &schema);
 
180
  static void rawStatement(Session&, const std::string &query, const std::string &schema);
193
181
 
194
 
  void rawStatement(Session& session, const std::string& query)
 
182
  static void rawStatement(Session& session, const std::string& query)
195
183
  {
196
184
    rawStatement(session, query, "");
197
185
  }
198
186
 
199
187
  /* transactions: interface to plugin::StorageEngine functions */
200
 
  int rollbackTransaction(Session&, bool all);
 
188
  static int rollbackTransaction(Session&, bool all);
201
189
 
202
190
  /**
203
191
   * Commit the current transaction.
212
200
   * stored functions or triggers. So we simply do nothing now.
213
201
   * This should be fixed in later ( >= 5.1) releases.
214
202
   */
215
 
  int commitTransaction(Session&, bool all);
 
203
  static int commitTransaction(Session&, bool all);
216
204
 
217
205
  /**
218
206
   * This is used to commit or rollback a single statement depending on
225
213
   * the user has used LOCK TABLES then that mechanism does not know to do the
226
214
   * commit.
227
215
   */
228
 
  int autocommitOrRollback(Session&, int error);
 
216
  static int autocommitOrRollback(Session&, int error);
229
217
 
230
218
  /* savepoints */
231
 
  int rollbackToSavepoint(Session&, NamedSavepoint &sv);
232
 
  int setSavepoint(Session&, NamedSavepoint &sv);
233
 
  int releaseSavepoint(Session&, NamedSavepoint &sv);
 
219
  static int rollbackToSavepoint(Session&, NamedSavepoint &sv);
 
220
  static int setSavepoint(Session&, NamedSavepoint &sv);
 
221
  static int releaseSavepoint(Session&, NamedSavepoint &sv);
234
222
 
235
223
  /**
236
224
   * Marks a storage engine as participating in a statement
250
238
   * @param[in] monitored Descriptor for the resource which will be participating
251
239
   * @param[in] engine Pointer to the TransactionalStorageEngine resource
252
240
   */
253
 
  void registerResourceForStatement(Session&,
254
 
                                    plugin::MonitoredInTransaction *monitored,
255
 
                                    plugin::TransactionalStorageEngine *engine);
 
241
  static void registerResourceForStatement(Session&, plugin::MonitoredInTransaction*, plugin::TransactionalStorageEngine*);
256
242
 
257
243
  /**
258
244
   * Marks an XA storage engine as participating in a statement
273
259
   * @param[in] engine Pointer to the TransactionalStorageEngine resource
274
260
   * @param[in] resource_manager Pointer to the XaResourceManager resource manager
275
261
   */
276
 
  void registerResourceForStatement(Session&,
 
262
  static void registerResourceForStatement(Session&,
277
263
                                    plugin::MonitoredInTransaction *monitored,
278
264
                                    plugin::TransactionalStorageEngine *engine,
279
265
                                    plugin::XaResourceManager *resource_manager);
302
288
   * time when this method is called except from the
303
289
   * TransactionServices::registerResourceForStatement method.
304
290
   */
305
 
  void registerResourceForTransaction(Session&,
306
 
                                      plugin::MonitoredInTransaction *monitored,
307
 
                                      plugin::TransactionalStorageEngine *engine);
308
 
 
309
 
  void registerResourceForTransaction(Session&,
310
 
                                      plugin::MonitoredInTransaction *monitored,
311
 
                                      plugin::TransactionalStorageEngine *engine,
312
 
                                      plugin::XaResourceManager *resource_manager);
313
 
 
314
 
  void allocateNewTransactionId();
 
291
  static void registerResourceForTransaction(Session&, plugin::MonitoredInTransaction*, plugin::TransactionalStorageEngine*);
 
292
 
 
293
  static void registerResourceForTransaction(Session&, plugin::MonitoredInTransaction*, plugin::TransactionalStorageEngine*, plugin::XaResourceManager*);
 
294
 
 
295
  static void allocateNewTransactionId();
315
296
 
316
297
  /**************
317
298
   * Events API
325
306
   * @retval true Success
326
307
   * @retval false Failure
327
308
   */
328
 
  bool sendStartupEvent(Session&);
 
309
  static bool sendStartupEvent(Session&);
329
310
 
330
311
  /**
331
312
   * Send server shutdown event.
335
316
   * @retval true Success
336
317
   * @retval false Failure
337
318
   */
338
 
  bool sendShutdownEvent(Session&);
 
319
  static bool sendShutdownEvent(Session&);
339
320
 
340
321
private:
341
322