Mailing List Archive

Multiple databases connection
Dear list

My organisation received databases uploaded from our branches. These branches databases are then restored into the main system. The Main Office then access to these databases individually.

Currently, separate copies of the same zope application is copied in the same Zope server corresponding to each branch database. The main reason is because we are unable to resolve database connection to multiple databases.

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.

Thank you.

CY

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Re: Multiple databases connection [ In reply to ]
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 fog@debian.org
INIT.D Developer fog@initd.org
L'unica cosa che riesco a produrre con una certa precisione nella mia
vita sono i dubbi. -- Natale Titotto
Multiple databases connection [ In reply to ]
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
Re: Multiple databases connection [ In reply to ]
--On 8. Juni 2006 22:19:17 -0700 Infor Gates <info_gates@yahoo.com> 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: info@zopyx.com - Phone +49 - 7071 - 793376
E-Publishing, Python, Zope & Plone development, Consulting
Re: Multiple databases connection [ In reply to ]
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: Multiple databases connection [ In reply to ]
Dear list

Thank you for all your replies and appreciate your comments given.

CY

Andrew Veitch <andrew@logicalware.com> wrote: 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




__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com