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
Post Reply
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

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 ...

I'm just being curious.
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 »

Hello radha,

I assume, you put both event nemes into the Events property of TZIBEventAlerter?

Best regards,

Jan
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 »

PS: Could you please provide a sample project and a sample database script? That would help in tracking down the issue.
Post Reply