[Zope] zSQl and changing connection ids?

David Hassalevris bluepaul@bluepaul.com
Sat, 31 Mar 2001 11:13:13 -0800


Hello Zope listers!,
Im about 3 months into Zope and find it persistently interesting and
humbling! 

Here's my question:
Can I dynamically change zSQL method's CONNECTION ID? 
If so, 
1) Would I use the "object manager?"
2) can this be done safely?  One consultant warned against this saying
it could create a "race condition" ... "if more than one user tried this
simultaneously".

Example:
  zSQL-method-1 has a default connection-id to a gvibDA Interbase
Connection which, in turn has a connection string attaching it to say,
our "los-angeles" database.

But a another client, in another folder, needs to connect to a different
(but identically structured) database.  It would be nice to be able to
"temporarily" alter zSQL-method-1's connection-id to another gvibDA
Connection (which points to a different database).

Clearly, I could write a "second set" of zSQL methods that only differ
from the first in terms of which database connection it refers to.  But
then one is maintaining an additional set of zSQL methods for each new
client :-(

What kinds of solutions can anyone recommend in cases like this?  
Much thanks,
David
ps - this is my first post to the group, forgive if I did this
incorrectly.