Subject AW: [IBO] IB Generators??
Author Kaputnik
> -----Ursprüngliche Nachricht-----
> Von: Daniel Bertin [mailto:daniel@...]
>
> thanks Helen,
>
> disp := datamodule1.IB_Connection1.Gen_ID(GEN_DISP_LEG_DISPNO,1);
> showmessage(inttostr(disp));
>
> disp = 2
>
>
> datamodule1.IBOtable1.fieldbyname('dispno').asinteger :=
>
> datamodule1.IB_Connection1.Gen_ID(GEN_DISP_LEG_DISPNO,1);
>
>
> does it update the generator counter automaticaly? like the next time
it
> is
> called (when another user does an insert) or another call like the
one
> above?
>
GEN_ID will increment the Generator exactly the amount given in the
call, in your case 1.
Generators are running outside of transactions and users, so a call for
GEN_ID will increment the Generator unrecoverable and intermittently
(and also not through a rollback).
Every other user calling GEN_ID will get an again incremented version.
Even if two users call GEN_ID for one generator at exactly the same time
will get two different values, as calls for GEN_ID are serialized in the
server-engine.


> thanks again for staightening this out for me.( and the delete
question
> also).
>
> Daniel
>