Python, mod_wsgi and persistance
I am doing a simple "Apache / mod_wsgi / python" app (no Framework needed) that will deliver PDFs from a path specified in a MySQL DB.
The below code is using a hard-coded PDF for testing. I want to maintain a pool to MySQL.
However, everytime the code below is called from Apache, won't ALL the objects be destroyed ? - including your PySQLPoolConnection obect?
How will the PySQLPoolConnetion objects survive the next connection from Apache? Are you launching a separate thread in the background that keeps going ?? How do we close the thread if Apache is no longer running ??
-------
def application(
status = '200 OK'
filename=
# I want to put connetion = PySQLConnection
# i want put query = PySQLQuery (..............)
# filename = QueryResut[myPath]
fileptr = open(filename,"rb") # read wholefile in (ad binary)
output = fileptr.read()
response_
start_
return [output]
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- PySQLPool Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Dr Haver for more information if necessary.