SQLite from SQLdb and Multithreading makes some trouble
Original Reporter info from Mantis: asdf121
-
Reporter name:
Original Reporter info from Mantis: asdf121
- Reporter name:
Description:
Hey,
I already posted in forum (https://forum.lazarus.freepascal.org/index.php/topic,42212.0.html) but seems it's not the right place for the issue.
It's an issue with sqlite and several transaction to one connection. There is another example in my forum post on page 2 which shows this issues with using transactions for sqlite.
I cannot find anything about this in wiki, so if it's a known restriction it should be mentioned there.
The attached code is based on sqlite and using some threads.
Steps to reproduce:
Compile and run the attached code.
Additional information:
Sometimes it works without problems but it also fails with one of the following errors:
- EDatabaseError: No such dataset registered : ""
- EAccessViolation: Access violation
- *** Error in `main': realloc(): invalid pointer: 0x000000000262cf98 ***
- Not all threads were executed/prints the writeln line
Even the use of stoUseImplicit does not help and I also tried all kinds of variation between using those transactions.
(I've tested with 3.0.0, 3.0.2 and 3.0.4)
Mantis conversion info:
- Mantis ID: 34274
- Version: 3.0.4
- Fixed in version: 3.3.1
- Fixed in revision: 42972 (#ffb2444d)
- Target version: 3.2.0