Re:Master/Detail problem with CacheUpdates
Rafael,
Please reply only to the newsgroup not to personal E-mail.
Quote
>>>>>> Copied from E-mail message:
I'm using Oracle 7.3.2, and if offers the capability of having a generator
(it works like a serial number). The main problem is
the secuence of the records, I can't jump any number in the secuence. And,
because of the multi-user environment, this could
be done very easy.
I was studying the MAST App Demo but it updates the MasterKey table every
time the insert button is pressed, and this
actions cost as much as a SELECT MAX from a small table.
I'm still trying to see why, when the changes are posted, if there's a record
with the same primary key and I update the
datasets with a new value, this values are not taken automatically.
<<<<<<
If you validate your data at the local level then the Generator will only be
incrementing when you are posting valid data and there should not be any
gaps. At least theoretically.
The example you viewed from the MAST App Demo, is the correct way to acquire
a unique PKey from a lookup table. The operation of determining the key and
updating it in the lookup table MUST BE ATOMIC. That is once the process
starts NOTHING can interrupt it adn no other operation can be made on the
lookup table by any other process. Unless this is atomic you can not assure
that the new key you select was also selected by another process. The time to
select the key from a lookup table is really trivial compared to the SELECT
MAX() from a small table. Your Master table is not likely to be small in any
case so if you try to do a SELECT MAX() on that table it will definitely be
no faster than from the lookup table.
Glenn.