2011/10/3 Ludo Brands <ludo.bra...@free.fr>

> **
>
>
>  I changed some values in some threaded code from using constants to
> looking up the values from a database and I have been getting errors all the
> time, that values which are present in the database are missed by the
> sequential scan. I have been getting some Externa SIGSEGVs a lot.
>
> The minimum requirement for multithreaded db access is to use a separate db
> connection for every thread and transaction isolation.
>
>
> I am not sure if the database library code is faulty or looking up the
> values in a thread is the problem
>
>
> Some database client libraries have problems with multithreading or have
> threadsafe versions (fe. libmysql.dll is not threadsafe in the standard
> version).
>
>
> The database lookup code is in a data module running in the main thread. Do
> I have to use a critical section in data module containing the threads to
> the database lookup?
>
>
> No. That is trying to solve the problem in the wrong place.
>
> Ludo
>
>

If I put a TCP component such as an Indy http component on that data module,
and get all the lookups to be done over the http socket, is that likely to
fix the problem, rather than calling the database lookup code in the data
module directly from the threads?



> --
> _______________________________________________
> Lazarus mailing list
> Lazarus@lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>
>


-- 
Frank Church

=======================
http://devblog.brahmancreations.com
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to