~jaypipes/drizzle/xa-transaction-log

« back to all changes in this revision

Viewing changes to drizzled/transaction_services.h

  • Committer: Jay Pipes
  • Date: 2010-02-25 04:27:11 UTC
  • Revision ID: jpipes@serialcoder-20100225042711-zy00dgge7d54qdjp
Completes the work of removing the weirdness around transaction
boundaries in the storage engine API.

* Transactional storage engines are now all explicitly notified
  of the start of a new "normal" transaction in the new PSE API
  method plugin::TransactionalStorageEngine::doStartTransaction()
  This new method takes a start_transaction_option_t as one of its
  parameters, and passing this option allows the storage engine
  API to cleanly signal the start of a consistent snapshot (and in
  the future additional transaction attributes).  This meant the
  removal of the old start_consistent_snapshot() method.

* The TransactionServices component now fully manages the transaction
  boundaries, notification of transaction boundaries to participating
  resource managers (transactional storage engines)

Adds a simple test case (to be expanded with future XA work) for
transaction behaviour.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
3
 *
4
4
 *  Copyright (C) 2008 Sun Microsystems
 
5
 *  Copyright (c) Jay Pipes <jaypipes@gmail.com>
5
6
 *
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
91
92
  void registerResourceForStatement(Session *session,
92
93
                                    plugin::TransactionalStorageEngine *engine);
93
94
 
94
 
  /* these are called by storage engines */
95
 
  void trans_register_ha(Session *session, plugin::TransactionalStorageEngine *engine);
 
95
  /**
 
96
   * Registers a resource manager in the "normal" transaction.
 
97
   *
 
98
   * @note
 
99
   *
 
100
   * This method is idempotent and must be idempotent
 
101
   * because it can be called both by the above 
 
102
   * TransactionServices::registerResourceForStatement(),
 
103
   * which occurs at the beginning of each SQL statement,
 
104
   * and also manually when a BEGIN WORK/START TRANSACTION
 
105
   * statement is executed. If the latter case (BEGIN WORK)
 
106
   * is called, then subsequent contained statement transactions
 
107
   * will call this method as well.
 
108
   *
 
109
   * @note
 
110
   *
 
111
   * This method checks to see if the supplied resource
 
112
   * is also registered in the statement transaction, and
 
113
   * if not, registers the resource in the statement
 
114
   * transaction.  This happens ONLY when the user has
 
115
   * called BEGIN WORK/START TRANSACTION, which is the only
 
116
   * time when this method is called except from the
 
117
   * TransactionServices::registerResourceForStatement method.
 
118
   */
 
119
  void registerResourceForTransaction(Session *session,
 
120
                                      plugin::TransactionalStorageEngine *engine);
96
121
};
97
122
 
98
123
} /* namespace drizzled */