Page 1 of 1

Delphi 7 Exception List index out of bound ()

Posted: 27.11.2015, 14:47
by top1
I have ZConnection and ZQuery on its own seperate thread but when the thread fires at the same time problems may occur

I find this thread http://zeoslib.sourceforge.net/viewtopic.php?t=3281

But I cant contact him for the solutions

Thanks for comments

Re: Delphi 7 Exception List index out of bound ()

Posted: 03.01.2016, 18:48
by marsupilami
Hello top1,

which Version of Zeos and Microsoft SQL Server do you use for this project? Which Zeos driver do you use?
With best regards,

Jan

Re: Delphi 7 Exception List index out of bound ()

Posted: 04.01.2016, 14:49
by top1
i'm using 7.2 with lasted rev with 10.1.8-MariaDB as server

i'm implementing some game when the socket calls receivetext i 'll call new thread every time , in thread , its has own tzconnection and tzquery , create every time when thread runs, thread can run in parallel

thank you

Re: Delphi 7 Exception List index out of bound ()

Posted: 04.01.2016, 18:55
by marsupilami
Hello Hello top1,

I am not sure if Zeos meets the requirements to use MariaDB in a threadsafe way. Other users reported for zeos to be threadsafe when used with Postgresql. Can you provide a callstack to see where this exeception is created by Zeos?

With best regards,

Jan

Re: Delphi 7 Exception List index out of bound ()

Posted: 05.01.2016, 14:48
by top1
i think my problem is my program can't share a component in parallel ? like tzquery or tzconnection even tzstoredproc?

do you have any suggestions for creating the game ?

Re: Delphi 7 Exception List index out of bound ()

Posted: 06.01.2016, 11:09
by marsupilami
Hello top1,

hmm - I don't know your program. The rule usually is that every thread needs its own TZConnection. One TZConnection object may not be shared between different threads. So as long as you have one TZConnection per Thread and as long as all Components in that thread use this TZConnection object things should be fine. Bud I didn't test that and also so don't know for sure. Also this would depend on the thread safety requirements of the underlying database client library.

If things don't work for you maybe some kind of producer - consumer pattern could work for you?

With best regards,

Jan