Forum > Database

sqlite unexpected access violations

<< < (2/7) > >>

TRon:
Please re-read my previous post Чебурашка as I have edited it.

Чебурашка:

--- Quote from: TRon on February 29, 2024, 11:33:56 am ---Please re-read my previous post Чебурашка as I have edited it.

--- End quote ---

I saw, but as I told, unless I missed something, this would be a problem when multiple threads concurrently access the same connection (then therefore the same database).

And this is absolutely not my case.

Maybe I am missing something then? I will try recompiling with 2.

TRon:

--- Quote from: Чебурашка on February 29, 2024, 11:38:12 am ---I saw, but as I told, unless I missed something, this would be a problem when multiple threads concurrently access the same connection (then therefore the same database).

--- End quote ---
That is not clear for me from reading the documentation. Nevertheless the library itself is just a single library and that is only opened once in your application (actually sqlitedyn does this behind the scenes).

Note that having configured everything as correct for sqlite itself it does not mean that the code used in FPC is threadsafe.

Чебурашка:

--- Quote from: TRon on February 29, 2024, 11:41:10 am ---That is not clear for me from reading the documentation. Nevertheless the library itself is just a single library and that is only opened once in your application (actually sqlitedyn does this behind the scenes).

--- End quote ---

I checked the sqlite docs and for what I can get, it seems that "-DSQLITE_THREADSAFE=1" is the right gcc option. From thier website:

--- Quote ---Use the SQLITE_THREADSAFE compile-time parameter to select the threading mode. If no SQLITE_THREADSAFE compile-time parameter is present, then serialized mode is used. This can be made explicit with -DSQLITE_THREADSAFE=1. With -DSQLITE_THREADSAFE=0 the threading mode is single-thread. With -DSQLITE_THREADSAFE=2 the threading mode is multi-thread.

--- End quote ---



--- Quote from: TRon on February 29, 2024, 11:41:10 am ---Note that having configured everything as correct for sqlite itself it does not mean that the code used in FPC is threadsafe.

--- End quote ---

Ops...

Чебурашка:

--- Quote from: Чебурашка on February 29, 2024, 11:38:12 am ---I will try recompiling with 2.

--- End quote ---

I added to sqlite/configure script the option

--enable-threadsafe

and I get the same

"-DSQLITE_THREADSAFE=1"

so this is the right option for threadsafeness.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version