00001 /* 00002 EyeDB Object Database Management System 00003 Copyright (C) 1994-2008 SYSRA 00004 00005 EyeDB is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2.1 of the License, or (at your option) any later version. 00009 00010 EyeDB is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 00018 */ 00019 00020 /* 00021 Author: Eric Viara <viara@sysra.com> 00022 */ 00023 00024 00025 #ifndef _EYEDB_TRANSACTION_PARAMS_H 00026 #define _EYEDB_TRANSACTION_PARAMS_H 00027 00028 namespace eyedb { 00029 00035 class TransactionParams { 00036 00037 public: 00044 TransactionParams(); 00045 00052 TransactionParams(TransactionMode trsmode, TransactionLockMode lockmode, 00053 RecoveryMode recovmode, unsigned int magorder, 00054 unsigned int ratiolart, unsigned int wait_timeout); 00055 00061 static Status setGlobalDefaultTransactionParams(const TransactionParams ¶ms); 00062 00067 static TransactionParams getGlobalDefaultTransactionParams(); 00068 00073 static void setGlobalDefaultMagOrder(unsigned int magorder); 00074 00079 static unsigned int getGlobalDefaultMagOrder(); 00080 00086 bool operator==(const TransactionParams ¶ms) const; 00087 00088 public: 00089 TransactionMode trsmode; 00090 TransactionLockMode lockmode; 00091 RecoveryMode recovmode; 00092 unsigned int magorder; /* estimated object cardinality in trans */ 00093 unsigned int ratioalrt; /* error returned if ratioalrt != 0 && 00094 trans object number > ratioalrt * magorder */ 00095 unsigned int wait_timeout; /* in seconds */ 00096 00097 private: 00098 static TransactionParams global_def_params; 00099 }; 00100 00104 } 00105 00106 #endif