Firebird + Zeos + Events
Moderators: gto, cipto_kh, EgonHugeist
-
- Fresh Boarder
- Posts: 2
- Joined: 26.10.2005, 15:03
- Location: Joao Pessoa - PB
Firebird + Zeos + Events
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!!
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!!
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
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.
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.
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).
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).
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
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
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
Events are ONLY a property of firebird. No other RDBMS have itTonyG 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.
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
checking...........mdaems wrote:Fabio, did you check Postgres? (I'm not a postgres user, but I heard about events or something similar)
Mark
Codebue Fabio
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
P-Soft - http://www.p-soft.biz
Firebird La Comunità Italiana - http://www.firebirdsql.it
GestionaleOpen - http://www.gestionaleopen.org
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^
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^
You do not have the required permissions to view the files attached to this post.