1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.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 ***************************************************************************/
18 #include<DatabaseManager.h>
19 #include<UserManager.h>
23 //Currently it suppors only READ REPEATABLE transaction isolation level.
24 //TODO::to implement READ COMMITTED and DIRTY READ isolation level
25 //NOT to DO: SERIALIZABLE isolation level
30 Connection() { session
= NULL
; }
31 ~Connection() { delete session
; }
32 DbRetVal
open(const char*username
, const char*password
);
34 DatabaseManager
* getDatabaseManager();
35 UserManager
* getUserManager();
36 DbRetVal
startTransaction();
43 virtual DbRetVal
open(const char*username
, const char*password
)=0;
44 virtual DbRetVal
close()=0;
46 virtual DatabaseManager
* getDatabaseManager()=0;
47 virtual UserManager
* getUserManager()=0;
49 virtual DbRetVal
startTransaction()=0;
50 virtual DbRetVal
commit()=0;
51 virtual DbRetVal
rollback()=0;
52 //TODO:: virtual int setAutoCommit(bool flag)=0;
53 //TODO::support for save points
54 virtual ~Session() { }