TZTable refresh?

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
slai
Senior Boarder
Senior Boarder
Posts: 53
Joined: 07.07.2006, 10:45
Location: office

TZTable refresh?

Post by slai »

Hey there

i've got a problem with TZTable. if my application runs on 2 computers and they connected to the same database then i've got a refresh problem on the TZTables. on the query's is see the new entrys in the database from pc nr.1 on pc nr.2 but with the Tables it doesn't work what i'm doing wrong?
On my connection i selected the transactionisolationlevel tiReadCommitted.

thanks for replys

firebird 1.5
lazarus 0.9.22
zeoslib 6.6.1 - beta
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Can you provide a small 2 connection sample project? That way it can be debugged easily by the developer who's looking for the error.
If you can export your sample data into a small sql script I can check for mysql (not using FB) if the problem exists there as well.

Mark
slai
Senior Boarder
Senior Boarder
Posts: 53
Joined: 07.07.2006, 10:45
Location: office

Post by slai »

Hy mdaems

i've created a little programm, you must set the dbconnection for you in designtime.

1. start the programm 2 times
2. edit append or delete an entry in programm 1
3. in programm 2 you can't see the changes

Thank you
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

To other readers :
We discussed this outside the forum when I tested. What slai wants is that the other programm instances automa(g)(t)ically feel that instance 1 changed something. This is currently impossible and certainly not planned.
Problem is the fact that the clients of most databases are not aware of each others actions. Only the server does and the server usually doesn't send the client information on own initiative.
Some ideas to work around this:
- Make some 'events' table and poll for it on a separate query. You can eventually warn the user about changes and ask if he wants to refresh. Or automatically refresh when the query data are not changed by the user yet.
- Use Query.Refresh and a timer (not really useable for big datasets) and I don't know the effect of doing this while changes in the query data are pending.

Mark
mse
Junior Boarder
Junior Boarder
Posts: 41
Joined: 17.07.2007, 06:30

Post by mse »

Or use DB events? MSEgui has them for FireBird and PostgreSQL (component tdbevent).

Martin
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

That would be ideal if it was implemented in zeoslib... We're missing people having knowledge of these databases AND time to spend... (I have some time but no knowledge, others have knowledge and no time...) If you search the forum you'll find this feature is on a lot of people's 'wanted' list. :twisted: Nobody who wants to put a reward on it?:twisted:

Just to help slai : can these events in firebird (and postgres) be polled by using normal sql statements like 'select * from db$events' (this statement is a bullshit example, never try!!)? That way people can build their own 'event support' while we wait for a 'native' zeoslib implementation. If possible, can somebody please post some syntax here?

Mark
mse
Junior Boarder
Junior Boarder
Posts: 41
Joined: 17.07.2007, 06:30

Post by mse »

MSEgui implementation of DB events is in lib/common/db/msedbevents.pas, mibconnection.pas and mpqconnection.pp. Feel free to use code pieces from MSEgui for ZeosLib if you find them useful.
Querying of asynchronous notifications by SQL select statement is not possible AFAIK.

Martin
Post Reply