Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to refresh query on client when server has update whithout disconnected and reconnect

I developed an Client/Server data base application, using Firebird IBdatabase, IBquery. I need to know how to refresh the data on the server AND client when one of them has update/insert query. The reason being that when I run a query on the client, after I inserted records into a table, the new records do not reflect in the queries. Until i disconnected and reconnect again

I'm using a Firebird DB with InterBase VCL, developing in Delphi XE2

like image 283
Hikmat Seraj Al-Din Avatar asked Dec 06 '25 12:12

Hikmat Seraj Al-Din


2 Answers

You don't have to disconnect the connection, but you will have to refresh (or close and reopen) the IBQuery. This is the case for most databases.

If you do not want this, you will have to send a notification from the database to all clients. I don't know if this would be doable from FireBird, but it is not common at all for databases to do this.

like image 66
GolezTrol Avatar answered Dec 09 '25 01:12

GolezTrol


The transaction type for your select query is probably snapshot. You can either start a new snapshot transaction each time you want to refresh, or use transaction type read committed.

like image 29
nater Avatar answered Dec 09 '25 01:12

nater