Subject Re: [Firebird-Architect] Re: the insert into t select * from t infinite loop
Author Alexander Klenin
On 7/6/05, unordained <unordained_00@...> wrote:
> So let's say you start a transaction by grabbing t# 1000 and 1001.
>
> You start your insert-from-select (would be infinite) and tell it to -only- see records that would
> have existed as of 1000, and ignore 1001 records. It inserts all new records as 1001. (Generalize
> this to insert/update/delete changes.)
>
> Now you start a second statement doing something similar, in the same transaction. But you're still
> using 1000 and 1001. Now what?

After the end of statement, update all changed records back to #1000.
This is safe and simple, but expensive -- might require 2x page writes.


> You'd have to grab a new transaction number for every statement, not just two, effectively using it
> as a compound key. How this might affect savepoints is beyond me, but I have a strange feeling it'd
> go badly. Plus, it messes with the transaction < transaction math.--
Of course. This is why I proposed pre-allocating the numbers.

--
Alexander S. Klenin
Insight Experts Ltd.