Bookstore

Recent

Author Topic: SQLite with SQLdb and Multithreading  (Read 8605 times)

lainz

  • Hero Member
  • *****
  • Posts: 3498
    • Lainz
Re: SQLite with SQLdb and Multithreading
« Reply #30 on: April 30, 2019, 04:05:28 am »
Hi, someone knows the bug report link and the status?

And Thaddy thanks for the code  :)

engkin

  • Hero Member
  • *****
  • Posts: 2513
Re: SQLite with SQLdb and Multithreading
« Reply #31 on: April 30, 2019, 04:57:09 am »
Hi, someone knows the bug report link and the status?

Link: 34274 and 34278
« Last Edit: April 30, 2019, 05:00:46 am by engkin »

lainz

  • Hero Member
  • *****
  • Posts: 3498
    • Lainz
Re: SQLite with SQLdb and Multithreading
« Reply #32 on: December 15, 2019, 06:29:40 pm »
Hi, someone knows the bug report link and the status?

Link: 34274 and 34278

Thanks. Seems that just adding soFullMutex is the way to go in Trunk.

Code: Pascal  [Select]
  1. SQLite3InitialConnection.OpenFlags := [sofReadWrite, sofCreate, sofFullMutex];

The connection can be used in multiple threads, as well the transaction!

Plus as I readed here https://www.sqlite.org/compile.html#threadsafe

Quote
This option controls whether or not code is included in SQLite to enable it to operate safely in a multithreaded environment. The default is SQLITE_THREADSAFE=1 which is safe for use in a multithreaded environment.

So I don't need to rebuild the DLL since the multithread is the default mode  :)