ZIBEventAlerter always return "after insert" event instead of "after update" event

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Locked
radha
Fresh Boarder
Fresh Boarder
Posts: 2
Joined: 16.07.2019, 07:46

ZIBEventAlerter always return "after insert" event instead of "after update" event

Post by radha »

ZeosLib 7.27.2.4-stable
Firebird 3.0.4
Lazarus 2.0.2
:D
I created a test code using
SQLQuery,SQLTransaction,IBConnection and FBEventMonitor.
the test code work fine.
and check with FlameRobin -> Database -> Tools --> Monitor Events
also work correctly.

but with ZeosLib 7.27.2.4-stable
ZIBEventAlerter1 Always return after insert event instead of after update event.

/*------------------------------

Code: Select all

ZConnection1.Autocommit := True;
ZQuery1.CachedUpdates:=True;
insert single record directly from dbgrid.

Code: Select all

  ZQuery1.ApplyUpdates; 
/* --------- After Insert Trigger ---------- */

Code: Select all

SET TERM ^ ;
CREATE TRIGGER ISSUES_AI FOR ISSUES ACTIVE
AFTER insert POSITION 0
AS
BEGIN
  post_event 'issue_added';
END^
SET TERM ; ^
/* --------- After Update Trigger ---------- */

Code: Select all

SET TERM ^ ;
CREATE TRIGGER ISSUES_AU FOR ISSUES ACTIVE
AFTER update POSITION 0
AS 
BEGIN 
    post_event 'issue_updated';
END^
SET TERM ; ^
Try with another ZQuery

Code: Select all

  ZQuery2.SQL:=ZQuery1.SQL;
  ZQuery2.Open;
  ZQuery2.Append;
  // Copy the current record
  for i := 0 to ZQuery1.FieldCount  - 1 do
  ZQuery2.Fields[i].Value := ZQuery1.Fields[i].Value; 
  ZQuery2.ApplyUpdates;
ZConnection TransactIsolationLevel = tiReadCommitted
Try with other TransactIsolationLevel ...

:D I'm just being curious. :D
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1999
Joined: 17.01.2011, 14:17

Re: ZIBEventAlerter always return "after insert" event instead of "after update" event

Post by marsupilami »

Locked because it is a duplicate of http://zeoslib.sourceforge.net/viewtopi ... 40&t=96042. PLease see there for further discussion.
Locked