Page 1 of 1

TZTable refresh?

Posted: 28.08.2007, 09:35
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

Posted: 28.08.2007, 10:15
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

Posted: 28.08.2007, 10:56
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

Posted: 29.08.2007, 13:45
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

Posted: 29.08.2007, 21:13
by mse
Or use DB events? MSEgui has them for FireBird and PostgreSQL (component tdbevent).

Martin

Posted: 30.08.2007, 08:26
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

Posted: 30.08.2007, 10:12
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