Pool not working only 1 connetion managed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PySQLPool |
New
|
Undecided
|
Nikoleta Verbeck |
Bug Description
I tested the version 0.3.5 + python 2.5 (windows) + multiple threads and it always open only 1 mysql connection, no matter what i try, so i guess pool is not working.
With version 0.3.4 + python 2.5(windows) + multiple threads pool works only with different variable names.
If you loop same varible only a single connection is pooled,
code:
connections.py module
mport PySQLPool,datetime
class Connections(
__pool= None
__connectio
def __init_
self.__pool = PySQLPool.
def returnQuery(self):
query= PySQLPool.
return query
#def returnConnectio
# self.__
#def clean(self):
# self.__
def close(self):
def commit(self):
test module:
import Connections
import threading
class comunidade(
def run(self):
con = Connections.
query = con.returnQuery()
for i in range(1,7000):
for row in query.record:
#Pooling works with this code version 0.3.4 (single connection with version 0.3.5)
c=comunidade()
ca=comunidade()
ci=comunidade()
c.start()
ca.start()
ci.start()
#Single connection, pooling not working with this code
c = comunidade()
for i in range (1,4):
c.start()
Changed in pysqlpool: | |
assignee: | nobody → Nick Verbeck (nerdynick) |
You will get \eclipse\ workspace\ python\ PloonOrkut\ src\control\ Main.py" , line 20, in <module> python25\ lib\threading. py", line 434, in start "thread already started")
Traceback (most recent call last):
File "D:\Development
cm.start()
File "C:\Arquivos de programas\
raise RuntimeError(
RuntimeError: thread already started
if execute the code
c = comunidade()
for i in range (1,4):
c.start()
please do :
#Single connection, pooling not working with this code
for i in range (1,4):
c = comunidade()
c.start()