Subject RE: [IBO] Multiple dbs and system wide unique keys
Author Alan McDonald
Brian,
I do this by spacing my generators - that's in fact the only difference
between the replicated db's, the generator for tables in dbmaster start at 0
, the generator in db2 starts at 500,000,000 an so on,
If course this requires that insert numbers are not going to ovetake you and
that the number of DB's is within range. The next option to to make a
composite PK, wher ethe genrators are all the same, but the tables jn DB
have a db field and generator field which combine to make the pk.

Alan

-----Original Message-----
From: Brian K. Woods [mailto:brian@...]
Sent: Wednesday, 11 December 2002 2:12 AM
To: IBObjects@yahoogroups.com
Subject: [IBO] Multiple dbs and system wide unique keys


> -----Original Message-----
> From: Lester Caine <lester@...>
> [mailto:lester@...]
> Sent: Tuesday, December 10, 2002 4:12 AM
> To: IBObjects@yahoogroups.com
> Subject: Re: [IBO] Network Connection
> ...
> You may have seen comments from me about local databases. We run a
> local copy of Firebird at each site, and so only transfer the changes
> from the master database. The result is very fast performance, and BT
> tell us that we are having trouble hitting 1% of the capacity we are
> paying for <g>

Lester,
I'm planning a project that would be well served by your type setup (local
dbs with a central master db).
Might I be so bold as to inquire how you worked out the keys? A straight
generator won't work in this situation since
each local db would have generators and would thus be generating duplicate
keys. I found an article on the
firebird site written by Dalton Calford which discussed using a 19 character
key with a section for server, db, table, and finally the text
representation of the generated integer value. It seems viable and
implementing the stored proc was a piece of cake. The only problem I've come
across in experimenting with it is that the generator links in ibo seem to
only want a generator. I haven't figured out how to get it to pull a
generated key from a stored procedure as smoothly as it handles getting a
generator's key value. I can, of course, use the beforepost event, but I
suspect ( haven't tried it yet ) that I will have problems when using some
of ibo's niftier features, such as master/detail and lookup linkings. I
know ibo does all the work correctly to coordinate the master/detail key
fetching from a generator, but I'm afraid that'll break down if I use
beforepost in the master - has anyone else used non-generator keys with
these special features?
Dalton's article was highly intriguing, as he talks about other relevant
issues like using stored procs and bots to handle the replication to and
from the central master db. I looked everywhere for more info on it, but
the single article was all I found. I tried to contact Dalton via email,
but was unsuccessful. If anyone can point me to more info on his system,
I'd appreciate it.
I know you don't want to give away the shop ( so to speak ), but any
guidance you or anyone else on the group could give me as I weigh options
would be greatly appreciated. There's nothing worse than getting into the
guts of implementation work and realizing that early architectural decisions
have backed you into a corner!

By the way,
I just want to say that of all the groups I subscribe to, this one is
outstanding in regard to attitude and willingness to share helpful
information. I learn something every day from you guys. You're great!

Thanks,
Brian




___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/