Beispiel #1
0
 def __init__(self,db_params):
     self.db_params=db_params
     self.db=None
     self.db=dbConnect(**self.db_params)
     global dbsession_counter
     self.sessionId="dbsession_"+str(dbsession_counter)
     dbsession_counter=dbsession_counter+1
     self.cursor=self.db.cursor()
     self.pool=None
     self.status="free"
Beispiel #2
0
 def __init__(self, db_params):
     self.db_params = db_params
     self.db = None
     self.db = dbConnect(**self.db_params)
     global dbsession_counter
     self.sessionId = "dbsession_" + str(dbsession_counter)
     dbsession_counter = dbsession_counter + 1
     self.cursor = self.db.cursor()
     self.pool = None
     self.status = "free"
Beispiel #3
0
def connect(sessionID=None):
   global session
   global current_session
   if sessionID==None:
       sessionID=current_session
   # check if cursor exists
   if not session.has_key(sessionID):
       logging.debug("Establishing session")
       session[sessionID]={}
       logging.debug("Creating connection object")
       session[sessionID]['connection']=dbConnect(**current_db)
       session[sessionID]['state']='connect'
       session[sessionID]['queries']=[]
Beispiel #4
0
def connect(sessionID=None):
    global session
    global current_session
    if sessionID == None:
        sessionID = current_session
    # check if cursor exists
    if not session.has_key(sessionID):
        logging.debug("Establishing session")
        session[sessionID] = {}
        logging.debug("Creating connection object")
        session[sessionID]['connection'] = dbConnect(**current_db)
        session[sessionID]['state'] = 'connect'
        session[sessionID]['queries'] = []