Correct implementation of pooling
The six lines of code on how to use PySqlPool confused me.
Im also new to python, so i dont understand how persistence works in python.
Im using mod_python under Apache (I suspect this may be the typical target audience for PySqlPool).
The initial call to PySql in your example is:
connection = PySQLPool.
I suspect the variable naming in the example may be confusing in that connection is not an actual Mysql connection as returned by MySQLdb.connect
Question 1)
Is connection in the above call the instance of the connection pool?
How do i ensure that the instance of the pool persists in a (mod_python) deployment?
(maybe i wouldnt have this question if i knew python implementations)
Question 2)
How do i obtain a connection like MySQLdb.connect from the connection pool?
From your example:
query = PySQLPool.
query does not follow the standard MySQLdb patterns.
Is there a reason why one should not be able to use the standard MySQLdb patterns?
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- PySQLPool Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- kris van der Merwe
- Solved:
- Last query:
- Last reply: