Author Topic: How use post_event in Lazarus (Firebird) with ZeosLib  (Read 9165 times)

Fortuna1

  • Full Member
  • ***
  • Posts: 164
How use post_event in Lazarus (Firebird) with ZeosLib
« on: December 28, 2008, 12:54:18 pm »
1) I put this in my Firebired base;

CREATE TRIGGER "My_table_MSG" FOR "My_table"
ACTIVE AFTER INSERT POSITION 0
AS
beg
POST_EVENT 'my_event';
end


2   ZeosLib   I put      ZConnection1 and ZIBEventAlerter1 and ZQuery1 on my form
ZConnection1.Contected:=false;
ZConnection1.AutoCommit:=true;


ZIBEventAlerter.Conection:=ZConnection1;

ZIBEventAlerter1.AutoRegister:=False;

ZIBEventAlerter1.Register:=False;
ZIBEventAlerter1.Events[0]:='my_event';

ZConnection1.Contected:=true;
ZIBEventAlerter1.RegisterEvents;
ZIBEventAlerter1.Register:=True;

and then dead

constructor TIBEventThread.Create(Owner: TZIBEventAlerter;
EventGrp: integer; TermEvent: TNotifyEvent);
begin
inherited Create(True); <-------------------------------------Drop dead
FCancelAlerts := False;
Signal := TSimpleEvent.Create;
Parent := Owner;
EventGroup := EventGrp;
OnTerminate := TermEvent;
Resume;
end;


What is wrong.

Thanks
« Last Edit: December 28, 2008, 01:05:11 pm by Fortuna1 »

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2706
Re: How use post_event in Lazarus (Firebird) with ZeosLib
« Reply #1 on: December 28, 2008, 03:19:46 pm »
What if you move the inherited Create(True); line to the Resume line and use inherited Create(False);

Create doesn't have to be at the first line if you only initialize your own membervars.
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

Fortuna1

  • Full Member
  • ***
  • Posts: 164
Re: How use post_event in Lazarus (Firebird) with ZeosLib
« Reply #2 on: December 28, 2008, 04:33:15 pm »
if change  this rows

ZIBEventAlerter1.Events[0]:='my_event';

with
ZIBEventAlerter1.Events[0]:=''

then not dead

but
of course, the work does not,


 

TinyPortal © 2005-2018