[solved] Unable to use ZeosLib with multiple connections

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
Sorien
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 18.04.2012, 12:29

[solved] Unable to use ZeosLib with multiple connections

Post by Sorien »

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

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;
#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
Zeos 7.0 - egonhugeist branch, DB charset and collation UTF-8, Connection UTF-8, Win7 64Bit
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1918
Joined: 17.01.2011, 14:17

Post by marsupilami »

Hello Sorien,

which transaction isolation level did you set in the first connection component? I tried this with Firebird 2.1 and a transaction isolation of tiReadCommitted and things worked as expected.
Best regards,

Jan
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

Sorien,

i answered your pm. i think Jan is right here.. IF the external editor OR Zeos(no AutoCommit) using "sessions" then it is impossible to see the changes between the two apps.

Michael
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Sorien
Fresh Boarder
Fresh Boarder
Posts: 13
Joined: 18.04.2012, 12:29

Post by Sorien »

its working, ty guys
Zeos 7.0 - egonhugeist branch, DB charset and collation UTF-8, Connection UTF-8, Win7 64Bit
Locked