[Zope] Session and objects

Dario Lopez-Kästen dario@ita.chalmers.se
Wed, 2 Oct 2002 08:04:37 +0200


From: "Oliver Bleutgen" <myzope@gmx.net>
> Bo M. Maryniuck wrote:
> > On Monday 30 September 2002 17:58, Oliver Bleutgen wrote:
> >
> >>Do you want/have something like per-user persistent DB connections,
> >>maybe with individual connection string (login/password)?
> >
> > Yes, exactly. Any ideas? ;-)
> >

Well, the way we did it is not very persistent, but we have managed to get
per user-connections utilising an external method, that opens and closes an
oracle connection for each sql-method. This is of course not particularely
efficient, but it works for what we need to do and, more importantly, since
we convert the results to normal python types (lists, dictionaries) we get a
most significant speed improvement when returning large result sets (and I
think we get a speed improvement in general, even if this sounds
contradictory).

This has to do with zope security checking the objects returned by the
normal zsql method (see list archives for backgroud), something that does
not happen with standard python types.

We also get the benefit of being able to use bind variables, which is a nice
bonus. One thing on the stuff-to-try-out list is to make the zsql-method
render its sql to text with bindvar placeholders  in it and then pass the
rendered text to the external method - if it works, it will allow us to make
use of the dynamic power of zsql-methods.

Re making these connections persistent or poolable, I really don't know how
to tackle that...

HTH somewhat,

/dario
- --------------------------------------------------------------------
Dario Lopez-Kästen, dario@ita.chalmers.se        IT Systems & Services
System Developer/System Administrator     Chalmers University of Tech.