Page 1 of 1
Firebird + Zeos + Events
Posted: 30.05.2006, 13:16
by silviojgfr
Hi, pals!
When I was using IBX, i had the IBEvents components which i could get events (posts, updates) on IB database and then manipulate in code (update a grid or something).
In Zeos Lib I couldn't see this component (*Events). Zeos has this feature via some other component or a class/unit? If not, some one have any idea on how can I do this FB Event treatment? And it will be present in future versions?
Thanx so much, and congratulations ZeosLib devs! Great Tool!!
Posted: 11.05.2008, 23:35
by mdaems
See downloads section for the rediscovered ZIBEventAlerter Component.
Mark
Posted: 17.05.2008, 02:52
by cipto_kh
Rediscovered? it's already done by you Mark? it's great, today I try it (rev 368), but nothing happen
Am I miss something?
Connect that component to TZConnection, and set AutoRegister to true, then I trap on EventAlert event but nothing happen, maybe there is some setting again?
Posted: 19.05.2008, 11:55
by mdaems
Cipto,
I think there's something wrong with the Autoregister stuff. Not sure but... Didn't really look into it yet.
I just took the old code I found, did some minor changes to adapt it to current version (actually, I think I only added the new protocols for FB and the firebird constants files)
I got it working with a FB embedded db.
What I did:
- add connection + connected TZIBEventAlerter
- add the Event string to TZIBEventAlerter.Events
- set ZIBEventAlerter1.Registered := True; at runtime after opening the connection.
Attention : when you raise the Event in a stored proc, make sure it is committed. (I have been waiting for Events for a long time until I found that.)
I don't have my test case right here. If you need it, mail me, so I can reply later on.
Posted: 10.06.2008, 15:25
by sveni2211
Hello.
I've a similar problem. Currently, i'm switching some projects from IBX to Zeos. And i need Events, too.
I got ZEOS from SVN. So i have got the latest Version (revision 370).
But i can't find the rediscovered Version of ZIbEventAlerter. On which directory it is?
I also try out to use the old Version (from 6.1.5 i think). With changes in uses- part and so on i'm able to compile it, but it crashed with error (read from $000000) if the register is called (Registered:=true).
Posted: 10.06.2008, 23:41
by mdaems
I suppose you used SVN trunk? Use testing branch. There the components are available.
My advice (for what it's worth):
- Don't try to set Registered to true at design time. It's a known bug. The error is raised because at the creation time of the Alerer the connection to the db using the library isn't made yet. RegisterEvents after opening the connection.
- Please test and make patches to avoid this problems. Maybe best solution is to make Register a registration with the ZConnection component which OnOpen checks what listeners should be added to the connection.
- Somebody out there really hoping to use Events a lot? We need him/her on the dev team!!
Mark
Posted: 23.06.2008, 21:20
by TonyG
Hello to all.
I use MySQL with ZEOS and I need events too. I would like to know if is it possible to know when a table have been changed (insert, delete or just update a record) for refreshing the data.
Thanks in advance.
Anthony.
Posted: 09.07.2008, 21:50
by fcodebue
TonyG wrote:Hello to all.
I use MySQL with ZEOS and I need events too. I would like to know if is it possible to know when a table have been changed (insert, delete or just update a record) for refreshing the data.
Thanks in advance.
Anthony.
Events are ONLY a property of firebird. No other RDBMS have it
Posted: 10.07.2008, 12:14
by mdaems
Fabio, did you check Postgres? (I'm not a postgres user, but I heard about events or something similar)
Mark
Posted: 10.07.2008, 22:39
by fcodebue
mdaems wrote:Fabio, did you check Postgres? (I'm not a postgres user, but I heard about events or something similar)
Mark
checking...........
Posted: 11.07.2008, 19:50
by TonyG
Interbase has events (probably that's wy Firebird has).
Anthony.
Posted: 11.07.2008, 20:43
by TonyG
Posted: 15.08.2008, 14:52
by seawolf
Me too I had problem with EventAlert. Taking at look it seems that synchronize calls blocks all the event threads (if your software doesn't use Application.ProcessMessages)
So changing Synchronize calls to TCriticalSection seems to work pretty well (for me
)
I've also add some lines to create_interbase.sql (I don't know if this is the right place) in order to send you also a test procedure
/*==============================================================*/
/* Events */
/*==============================================================*/
CREATE PROCEDURE PROCEDURE_TEST_EVENT_1
AS
BEGIN
POST_EVENT 'my event 1';
END^
CREATE PROCEDURE PROCEDURE_TEST_EVENT_2
AS
BEGIN
POST_EVENT 'my event 2';
END^
Posted: 15.08.2008, 23:56
by mdaems
Hi Seawolf,
Unfortunately your patch does not compile on fpc/lazarus. So I changed it, with the old situation IFDEFed for FPC.
However : my very simple test program failed. I'll send it to you using mail, so you can try yourself. Meanwhile, I can't accept hte patch.
Mark