Re: [Zope-DB] Multiple databases connection
If you add a ZSQL Method and then go to the 'Advanced' tab you can specify a 'Connection Hook'. This should be the name of a Python Script or some other method which will return the name of the database connection to use allowing you to dynamically change the DB connection. A On 9 Jun 2006, at 06:19, Infor Gates wrote: My apologies if my query is unclear. M.Banaouas got it right. Let try to explain it another way: 1. We have a standard Zope application which is replicated in ZMI. 2. the difference in each Zope application is DBconnection. 3. Each DBconnection is connection to each Branch database. In other words, if I have 10 branches, I will replicate 10 times of the same Zope application which is not a wise thing to do. As such, I exploring to find a way if there is "dynamically" way to change the db connection to the intended (branch) database. Thus eliminating the Zope application replication. Thank you. CY - > 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 ? __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Zope-DB] Multiple databases connection
--On 8. Juni 2006 22:19:17 -0700 Infor Gates <[EMAIL PROTECTED]> wrote: My apologies if my query is unclear. M.Banaouas got it right. Let try to explain it another way: 1. We have a standard Zope application which is replicated in ZMI. 2. the difference in each Zope application is DBconnection. 3. Each DBconnection is connection to each Branch database. In other words, if I have 10 branches, I will replicate 10 times of the same Zope application which is not a wise thing to do. As such, I exploring to find a way if there is "dynamically" way to change the db connection to the intended (branch) database. Thus eliminating the Zope application replication. I think our answers were clear enough. Zope does not support this by default. If you want to have this feature, you must code it on your own or pay someone to code it for you. -aj -- ZOPYX Ltd. & Co. KG - Charlottenstr. 37/1 - 72070 Tübingen - Germany Web: www.zopyx.com - Email: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting pgpGzwIusah8A.pgp Description: PGP signature ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
[Zope-DB] Multiple databases connection
My apologies if my query is unclear. M.Banaouas got it right. Let try to explain it another way:1. We have a standard Zope application which is replicated in ZMI.2. the difference in each Zope application is DBconnection.3. Each DBconnection is connection to each Branch database.In other words, if I have 10 branches, I will replicate 10 times of thesame Zope application which is not a wise thing to do. As such,I exploring to find a way if there is "dynamically" way tochange the db connection to the intended (branch) database. Thus eliminating the Zope application replication.Thank you.CY-> 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 ? __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Fwd: Re: [Zope-DB] Multiple databases connection]
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
Re: [Fwd: Re: [Zope-DB] Multiple databases connection]
--On 8. Juni 2006 09:59:28 +0200 Federico Di Gregorio <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED] - Phone +49 - 7071 - 793376 E-Publishing, Python, Zope & Plone development, Consulting pgpvsSm2ak71m.pgp Description: PGP signature ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
Re: [Fwd: Re: [Zope-DB] Multiple databases connection]
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[EMAIL PROTECTED] INIT.D Developer [EMAIL PROTECTED] The reverse side also has a reverse side. -- Japanese proverb signature.asc Description: This is a digitally signed message part ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db
[Fwd: Re: [Zope-DB] 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: [Zope-DB] Multiple databases connection
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 -- Federico Di Gregorio http://people.initd.org/fog Debian GNU/Linux Developer[EMAIL PROTECTED] INIT.D Developer [EMAIL PROTECTED] L'unica cosa che riesco a produrre con una certa precisione nella mia vita sono i dubbi. -- Natale Titotto signature.asc Description: This is a digitally signed message part ___ Zope-DB mailing list Zope-DB@zope.org http://mail.zope.org/mailman/listinfo/zope-db