Mailing List Archive

[Fwd: Re: Multiple databases connection]
May be "dynamically database connection" means that we use the same "Z
SQL Method" with different database connections (in the same Zope
Instance, of course). So we can change "dynamically" from one database
to another (schema-equal).

In other words, is it possible to define "database connection" property
of a "Z SQL Method" like we do for parameters ?
thanks.



On mer, 2006-06-07 at 18:49 -0700, Infor Gates wrote:
> Is there anyway where we can have a dynamically database connection to
> each branch database with only one zope application (instead of
> multiples of the same application).
>
> We are using Zope 2.8.6, Postgresql 8.0.4 with Psycopg-1.1.21
> connector.

I don't understand what you mean by "dynamically database connection",
but Zope supports connections to multiple databases by simply creating
muiltiple connections objects ("Z Psycopg Connection" objects in your
case).

federico



_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db
Re: [Fwd: Re: Multiple databases connection] [ In reply to ]
On gio, 2006-06-08 at 09:57 +0200, m.banaouas wrote:
> May be "dynamically database connection" means that we use the same "Z
> SQL Method" with different database connections (in the same Zope
> Instance, of course). So we can change "dynamically" from one database
> to another (schema-equal).
>
> In other words, is it possible to define "database connection" property
> of a "Z SQL Method" like we do for parameters ?

I don't think so, but I am no (longer) a Zope wizard. :)

federico

--
Federico Di Gregorio http://people.initd.org/fog
Debian GNU/Linux Developer fog@debian.org
INIT.D Developer fog@initd.org
The reverse side also has a reverse side. -- Japanese proverb
Re: [Fwd: Re: Multiple databases connection] [ In reply to ]
--On 8. Juni 2006 09:59:28 +0200 Federico Di Gregorio <fog@initd.org> wrote:

>> In other words, is it possible to define "database connection" property
>> of a "Z SQL Method" like we do for parameters ?
>
> I don't think so, but I am no (longer) a Zope wizard. :)
>

I am pretty sure you can do it with little coding. Since the DA (or its
ID is just a property or attribute (check the implemenation) you should be
able to modify it.

Andreas

--
ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany
Web: www.zopyx.com - Email: info@zopyx.com - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope & Plone development, Consulting
Re: [Fwd: Re: Multiple databases connection] [ In reply to ]
Andreas Jung wrote at 2006-6-8 10:12 +0200:
> ...
>I am pretty sure you can do it with little coding. Since the DA (or its
>ID is just a property or attribute (check the implemenation) you should be
>able to modify it.

And someone already did this: he had implemented a special
"Z SQL Method" class that allows to compute the connection id
dynamically.

The code did not reach the Zope core -- and I forgot the name
for the extension. But your favorite search engine might
nevertheless find it.



--
Dieter
_______________________________________________
Zope-DB mailing list
Zope-DB@zope.org
http://mail.zope.org/mailman/listinfo/zope-db