Design issue: How to get always fresh data with Zeos TZConnection and TZQuery (in AutoCommit mode)?
Posted: 27.12.2018, 09:18
I have Delphi application with TZConnection in AutoCommit mode (connecting to the Firebird 3.0) in the global DataModule, this single connection serves all the queries in all the datamodules of the application.
But I have the problem, that the queries see only the data that were committed during the connection phase and queries do not the the new/fresh data that are coming either from the other application instances or from the other components (e.g. IBX datasetes) of the same application.
TZConnection.Reconnect solves this problem, but I am not sure what happend with the other open forms during such hard Reconnect.
Mostly it would be so nice to have TZonnection.CommitRetaining or RollbackRetaining procedures (similar to what IBX TIBTransaction have), but TZConnection do not have such functions and even TZConnection.Commit does not work in AutoCommit mode (the error is raised that Commit is incompatible with AutoCommit mode).
So - what is the best practice how to get fresh data using TZConnection. I would be happy to execute some function on the TZonnection upon opening new DataModule or upon client request for the new report.
This same question I have asked in SO https://stackoverflow.com/questions/538 ... tocommit-m but without responses there.
But I have the problem, that the queries see only the data that were committed during the connection phase and queries do not the the new/fresh data that are coming either from the other application instances or from the other components (e.g. IBX datasetes) of the same application.
TZConnection.Reconnect solves this problem, but I am not sure what happend with the other open forms during such hard Reconnect.
Mostly it would be so nice to have TZonnection.CommitRetaining or RollbackRetaining procedures (similar to what IBX TIBTransaction have), but TZConnection do not have such functions and even TZConnection.Commit does not work in AutoCommit mode (the error is raised that Commit is incompatible with AutoCommit mode).
So - what is the best practice how to get fresh data using TZConnection. I would be happy to execute some function on the TZonnection upon opening new DataModule or upon client request for the new report.
This same question I have asked in SO https://stackoverflow.com/questions/538 ... tocommit-m but without responses there.