1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
* @file Transaction processing code
24
#ifndef DRIZZLED_TRANSACTION_SERVICES_H
25
#define DRIZZLED_TRANSACTION_SERVICES_H
30
/* some forward declarations needed */
40
* This is a class which manages the XA transaction processing
43
class TransactionServices
49
TransactionServices() {}
53
* Returns the singleton instance of TransactionServices
55
static inline TransactionServices &singleton()
57
static TransactionServices transaction_services;
58
return transaction_services;
60
/* transactions: interface to plugin::StorageEngine functions */
61
int ha_commit_one_phase(Session *session, bool all);
62
int ha_rollback_trans(Session *session, bool all);
64
/* transactions: these functions never call plugin::StorageEngine functions directly */
65
int ha_commit_trans(Session *session, bool all);
66
int ha_autocommit_or_rollback(Session *session, int error);
69
int ha_rollback_to_savepoint(Session *session, NamedSavepoint &sv);
70
int ha_savepoint(Session *session, NamedSavepoint &sv);
71
int ha_release_savepoint(Session *session, NamedSavepoint &sv);
72
bool mysql_xa_recover(Session *session);
74
/* these are called by storage engines */
75
void trans_register_ha(Session *session, bool all, plugin::StorageEngine *engine);
78
} /* namespace drizzled */
80
#endif /* DRIZZLED_TRANSACTION_SERVICES_H */