triggers
Moderators: gto, cipto_kh, EgonHugeist, mdaems
I have 2 applications.. the 1st one is working to update my table, and the 2nd will try to see if there is any new updating. Now a days I am using a TTimer with an opened query, so time to time I issue a refresh to the query. With Interbase I could create a trigger, so after any change (controlling as insert/delete/update), my application could 'fell' that change and only call the refresh if really necessary, saving a lot of database processing. My application had a component that act as semaphore and it simple receives a string, that I could put anything on that, as 'data_inserted'... i.e.
Any suggestion?
Any suggestion?
PostgreSQL notifies for ZeosDBO
I have written (see attach) successor TZAbstractNotification (port from old Zeos), is used in a separate thread in my application.
Yours faithfully, Konstantin.
PS: Sorry for my bad English
Yours faithfully, Konstantin.
PS: Sorry for my bad English
You do not have the required permissions to view the files attached to this post.
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
Thanks Konstantin!!
I'll move this thread to the feature requests forum. That way we may not 'forget' it when we go on after version 6.6.
Maybe we should try to make it more 'general' in that sense that we should be able to create a Notify object from the connection, without actually knowing the database that is used. The actual implementation would depend on the connection (and fail for all databases not supporting it).
Mark
I'll move this thread to the feature requests forum. That way we may not 'forget' it when we go on after version 6.6.
Maybe we should try to make it more 'general' in that sense that we should be able to create a Notify object from the connection, without actually knowing the database that is used. The actual implementation would depend on the connection (and fail for all databases not supporting it).
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
I checked the code that's already present.
Just add your code to ZDbcPostgreSql.pas,
Overwrite TZAbstractConnection.CreateNotification
Then you can
1) Add a function CreateNotification to TZConnection to create an AbstractNotification object you can use. Maybe this is not optimal as you will have to maintain it yourself in your app.
2) (I would like this) Create a new component TZEventListener (or something like that) similar to TZSequence which uses the FConnection.DbcConnection.CreateNotification call.
Do you think you can do that?
Mark
Just add your code to ZDbcPostgreSql.pas,
Overwrite TZAbstractConnection.CreateNotification
Then you can
1) Add a function CreateNotification to TZConnection to create an AbstractNotification object you can use. Maybe this is not optimal as you will have to maintain it yourself in your app.
2) (I would like this) Create a new component TZEventListener (or something like that) similar to TZSequence which uses the FConnection.DbcConnection.CreateNotification call.
Do you think you can do that?
Mark
- mdaems
- Zeos Project Manager
- Posts: 2766
- Joined: 20.09.2005, 15:28
- Location: Brussels, Belgium
- Contact:
No Shomer,
The new 6.6 version does not contain such feature as a component.
The main reasons for this are :
- there's nobody using Pgsql on the team who can develop it.
- there's somebody needed who's used to write threaded applications as this kind of component will have to be waiting for input from the server while the application goes on. The developer will have to take into account behaviour of other databases in order to develop a component which works the same way, independent of the server used.
So, if you feel like going for it, please feel free to contact me.
If not, you will have to work with Konstantins port above until somebody else shows up. I know about somebody who's willing to implement it for Firebird, but he's also very new in zeosdbo development. When he succeeds it may be easier to add pgsql support. So stay tuned and have a look again next year.
Mark
The new 6.6 version does not contain such feature as a component.
The main reasons for this are :
- there's nobody using Pgsql on the team who can develop it.
- there's somebody needed who's used to write threaded applications as this kind of component will have to be waiting for input from the server while the application goes on. The developer will have to take into account behaviour of other databases in order to develop a component which works the same way, independent of the server used.
So, if you feel like going for it, please feel free to contact me.
If not, you will have to work with Konstantins port above until somebody else shows up. I know about somebody who's willing to implement it for Firebird, but he's also very new in zeosdbo development. When he succeeds it may be easier to add pgsql support. So stay tuned and have a look again next year.
Mark