Example #1
0
	def __init__(self, mincached=50, maxcached=100, maxshared=0, \
			maxconnections=500, blocking=False, \
			host='localhost', user='******', passwd='', dbname='test', \
			port=3306, charset='utf8', unix_socket=None):
		'''Constructor'''
		mysql.__init__(self, host, user, passwd, dbname, port, charset, unix_socket)
		
		self.creator=_mysql
		self.mincached=mincached
		self.maxcached=maxcached
		self.maxshared=maxshared
		self.maxconnections=maxconnections
		self.blocking=blocking
		
		pooled_base.__init__(self)
		
		# init pool
		if unix_socket:
			self.pool=pooled(self.creator, self.mincached, self.maxcached, \
					self.maxshared, self.maxconnections, self.blocking, \
					host = self.host, user = self.user, passwd = self.passwd, \
					db = self.dbname, port=self.port, charset=self.charset, \
					unix_socket=self.unix_socket)
		else:
			self.pool=pooled(self.creator, self.mincached, self.maxcached, \
					self.maxshared, self.maxconnections, self.blocking, \
					host = self.host, user = self.user, passwd = self.passwd, \
					db = self.dbname, port=self.port, charset=self.charset)
Example #2
0
	def __init__(this, mysql_conf, pool_conf):
		this.pool_conf=pool_conf
		mysql_database.__init__(this, mysql_conf)
		this.pool=pooled(this._mysql_conn_factory, **pool_conf)
	def __init__(this, mysql_conf, pool_conf):
		this.pool_conf=pool_conf
		mysql_database.__init__(this, mysql_conf)
		this.pool=pooled(this._mysql_conn_factory, **pool_conf)