1912116 remove getMaxTrans and getMaxThreads from Config
[csql.git] / include / SqlLogConnection.h
blob7a5cd2a210cc19833f3c3366251f3f11c89760ce
1 /***************************************************************************
2 * Copyright (C) 2007 by Prabakaran Thirumalai *
3 * praba_tuty@yahoo.com *
4 * *
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. *
9 * *
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. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
20 #ifndef SQLLOGCONNECTION_H
21 #define SQLLOGCONNECTION_H
22 #include<CSql.h>
23 #include<AbsSqlConnection.h>
24 #include<SqlFactory.h>
25 #include<Util.h>
26 #include<Network.h>
28 /**
29 * @class SqlLogConnection
32 class SqlLogConnection : public AbsSqlConnection
34 Connection dummyConn;
36 //stores all the sql log packets to be shipped to peers
37 List logStore;
39 //stores all the prepare log packets to be shipped to peers
40 //as soon as connection is established to cache server
41 //all these packets are sent to it
42 List prepareStore;
44 //sync mode of the current transaction
45 //will be modified by the SqlLogStatement based on the table
46 DataSyncMode syncMode;
48 //stores client objects in it for peer
49 NetworkTable nwTable;
51 static UniqueID txnUID;
53 public:
54 SqlLogConnection(){innerConn = NULL; syncMode = TSYNC;}
56 //Note::forced to implement this as it is pure virtual in base class
57 Connection& getConnObject(){ return dummyConn; }
59 DbRetVal connect (char *user, char * pass);
61 DbRetVal disconnect();
63 DbRetVal commit();
65 DbRetVal rollback();
67 DbRetVal beginTrans (IsolationLevel isoLevel);
69 DbRetVal addPacket(BasePacket *pkt);
71 DbRetVal addPreparePacket(PacketPrepare *pkt);
72 DbRetVal removePreparePacket(int stmtid);
74 DbRetVal setSyncMode(DataSyncMode mode);
75 DataSyncMode getSyncMode() { return syncMode; }
76 DbRetVal sendAndReceive(NetworkPacketType type, char *packet, int length);
77 friend class SqlFactory;
80 #endif