1 /***************************************************************************
2 * Copyright (C) 2007 by www.databasecache.com *
3 * Contact: praba_tuty@databasecache.com *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
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 ***************************************************************************/
40 InsertHashIndexOperation
= 3,
41 UpdateHashIndexOperation
= 4,
42 DeleteHashIndexOperation
= 5
48 OperationType opType_
;
58 IsolationLevel isoLevel_
;
60 TransHasNode
*hasLockList_
;
62 UndoLogInfo
*firstUndoLog_
;
64 LockHashNode
*waitLock_
;
66 DbRetVal
releaseAllLocks(LockManager
*lockManager_
);
68 void updateWaitLock(LockHashNode
*node
) { waitLock_
= node
; }
69 void removeWaitLock() { waitLock_
= NULL
; }
70 DbRetVal
insertIntoHasList(Database
*sysdb
, LockHashNode
*node
);
71 DbRetVal
removeFromHasList(Database
*sysdb
, void *tuple
);
72 bool findInHasList(Database
*sysdb
, LockHashNode
*node
);
74 void appendUndoLog(Database
*sysdb
, OperationType type
, void *data
, size_t size
);
75 void appendLogicalUndoLog(Database
*sysdb
, OperationType type
, void *data
,
76 size_t size
, void* indexPtr
);
77 UndoLogInfo
* createUndoLog(Database
*sysdb
, OperationType type
, void *data
,
79 void addAtBegin(UndoLogInfo
* logInfo
);
81 UndoLogInfo
* popUndoLog();
82 DbRetVal
removeUndoLogs(Database
*sysdb
);
83 DbRetVal
applyUndoLogs(Database
*sysdb
);
86 class TransactionManager
89 TransactionManager() { trans
= NULL
; }
90 ~TransactionManager() {}
92 Transaction
*firstTrans
;
94 void setFirstTrans(Transaction
*trans
);
95 void setTrans(Transaction
*trans
);
97 DbRetVal
startTransaction(IsolationLevel level
);
98 DbRetVal
commit(LockManager
*lManager_
);
99 DbRetVal
rollback(LockManager
*lManager_
);