[solved] Unable to use ZeosLib with multiple connections
Posted: 14.08.2012, 12:27
When i try to query for data changed during another connection, zeos components will not return correct data
steps to reproduce problem:
#1, 1st connection calls query like
SELECT DISTINCT(data) FROM test_table
and result is 1, 2, 3, 4, 5
#2, 2nd connection/external editor updates data to 1, 9, 3, 4, 5
#3, when i execute first query(code block) again from 1st connection it will return 1, 2, 3, 4, 5 instead of 1, 9, 3, 4, 5 query will not return fresh data but cached.
tested with mysql and firebird connections using egonhugeist branch revision 1338 and 1645, old DBX components don't have this problem
steps to reproduce problem:
#1, 1st connection calls query like
SELECT DISTINCT(data) FROM test_table
and result is 1, 2, 3, 4, 5
Code: Select all
query:= TZReadOnlyQuery.Create(nil);
query.Connection := ZConnection1;
query.SQL.Text:= 'SELECT DISTINCT(data) FROM test_table';
query.Open;
while not query.Eof do begin
Memo1.Lines.Add(query.Fields[0].AsString);
query.Next;
end;
query.Close;
#3, when i execute first query(code block) again from 1st connection it will return 1, 2, 3, 4, 5 instead of 1, 9, 3, 4, 5 query will not return fresh data but cached.
tested with mysql and firebird connections using egonhugeist branch revision 1338 and 1645, old DBX components don't have this problem