Well,
I'm trying implement this then in my code.py I have this code:
from model import setDB, unsetDB
def db_handler(handler):
setDB()
result=handler()
unsetDB()
return result
webapp = web.application(urls, globals())
webapp.add_processor(db_handler)
im my model.py I have this code:
db = web.database(dbn=DBN, host=HOST, db=DB, user=USER, pw=PWD)
def unsetDB():
print '>>>>>>>>> in the unset <<<<<<<<<<<'
db = None
print str(db)
def setDB():
print '>>>>>>>>> in th SET <<<<<<<<<<<'
unsetDB()
db = web.database(dbn=DBN, host=HOST, db=DB, user=USER, pw=PWD)
print str(db)
but when I look in my system process monitor I still have a opened
connection with database
any idea ?
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/webpy/-/PpP3Kl-JilMJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/webpy?hl=en.