Subject Re: [IBO] Newbie: "Comuted By" and other questions
Author Lukas Zeller
Helen,

At 14:45 +1000 22.10.2001, you, Helen Borrie wrote:
> >2) My other question is about TRIGGERS. I understand the
>TRIGGERS are fired when the table mode changes, i.e.... during
>INSERTS and UPDATES. When I defined the trigger in the table I
>don't see it working when I call a Delphi function like
>PERSONAL.Insert. What am I missing?
>
>Triggers don't fire until the COMMIT process begins. The Insert
>function is a client method that sets up a new row on the client
>side, ready to accept input parameters into the columns. It's
>impact on the database is nil until Post is called - but even then,
>the new row is created only as a row version in the current
>transaction's cache. At that point it must be committed or rolled
>back to complete and actually store the row permanently. If Commit
>is called and the row is valid, the triggers will then fire. If it
>fails, everything fails (including any work the triggers might have
>done so far).
Just for curiosity: Are you sure this is 100% correct?

I thought that triggers fire when a change is POSTed. Of course, the changes
caused by the trigger happen in the current transaction's context,
and will only
get permanent with COMMIT.

At least, that's the way it appears to be when using IBO: I have a table that
uses BEFORE UPDATE triggers to calculate some dependent field's value
in a table.
To make this calculation's result visible for the user, I call Post
on the dataset
(and have BufferSynchroFlags set to AfterEdit). However, I can still
call Transaction.Rollback to cancel the all the changes - so I
conclude that
no (implicit, IBO-internal magic :-) commit has taken place in between.

Did I just misunderstand your statement above then?

Regards,
--
Lukas Zeller (luz@...)
-
Synthesis AG, Sustainable Software Concepts
info@..., http://www.synthesis.ch