[Zope-DB] Connections to DB - Opening & closing
Dieter Maurer
dieter@handshake.de
Wed, 16 Jul 2003 21:38:29 +0200
Samir Mishra wrote at 2003-7-16 08:50 +0400:
> I have a few python scripts that I'm using to execute SQL scripts. Each time
> I submit a set of statements, I have to open a connection & then after I'm
> done, close the connection. I feel that I'd get better performance if I were
> to use the connection Zope's already established to the DB. Does anyone know
> how I can do this?
There is not Zope API for this. Therefore,
different DA's encapsulate their connection and/or cursor in
different ways.
Look at the source of your DA.
Do not forget to register the "DA" with Zope's transaction system.
Look at the "query" method in "<yourDA>/db.py".
Dieter