[Zope-DB] Proper way to do DB connections from external methods?

Dave Cinege dcinege-mlists-dated-1091242644.04cdcc at psychosis.com
Sun Jul 25 22:57:15 EDT 2004


I'm working on my first project in Zope. The application is more dependant on 
logic then presentation, so I'm pretty well settled that coding the majority 
of it in python external methods will work the best for for me. 

Right now I am just directly opening (and not closing...yes bad) a MySQL 
connection with each call to an external method. I've no interest in using 
zsql methods, as I am very happy using my own sql wrapper class, and do not 
want to change. 

What is the 'correct' thing to do with this DB connection? Should I have my 
external sql class be accessing a ZDatabase Connection object? Or should I 
still open my own connection, and if so how do I do this properly with 
persistance? (Examples please as I'm still pretty weak on the Zope API...)

Dave



More information about the Zope-DB mailing list