Logo Search packages:      
Sourcecode: zope-mysqlda version File versions  Download package

def ZMySQLDA::DA::Connection::connect (   self,
  s 
)

Base API. Opens connection to mysql. Raises if problems.

Definition at line 149 of file DA.py.

00149                         :
        """ Base API. Opens connection to mysql. Raises if problems.
        """
        pool_key = self._pool_key()
        connection = database_connection_pool.get(pool_key)
        if connection is not None and connection.connection == s:
            self._v_database_connection = connection
            self._v_connected = connection.connected_timestamp
        else:
            if connection is not None:
                connection.closeConnection()
            DB = self.factory()
            DB = DBPool(DB, create_db=self.auto_create_db,
                    use_unicode=self.use_unicode)
            database_connection_pool_lock.acquire()
            try:
                database_connection_pool[pool_key] = connection = DB(s)
            finally:
                database_connection_pool_lock.release()
            self._v_database_connection = connection
            # XXX If date is used as such, it can be wrong because an 
            # existing connection may be reused. But this is suposedly
            # only used as a marker to know if connection was successfull.
            self._v_connected = connection.connected_timestamp

        return self # ??? why doesn't this return the connection ???
        
    def sql_quote__(self, v, escapes={}):


Generated by  Doxygen 1.6.0   Back to index