Forum > Database

sqlite unexpected access violations

<< < (5/7) > >>

Чебурашка:

--- Quote from: TRon on February 29, 2024, 01:18:23 pm ---I solved it this way:

--- End quote ---

I just tried the same.
It it like you say, not needed to open the connection, but just InitializeSQLite/ReleaseSQLite is enough.

Unfortunately InitializeSQLite is a deprecated method and therefore it might be removed in future.

Also it should be invesitigated why using the library like in the example raises the access violations, because the feeling is that who wrote the fp code wanted to implement a threadsafe refcounting mechanism. Why use interlockedincrement otherwise?

TRon:

--- Quote from: Чебурашка on February 29, 2024, 01:25:23 pm ---Unfortunately InitializeSQLite is a deprecated method and therefore it might be removed in future.

--- End quote ---
InitialiseSQLite is indeed  ;)


--- Quote ---Also it should be invesitigated why using the library like in the example raises the access violations, because the feeling is that who wrote the fp code wanted to implement a threadsafe refcounting mechanism. Why use interlockedincrement otherwise?

--- End quote ---
Unfortunately I can not answer that question.

Чебурашка:

--- Quote from: Zvoni on February 29, 2024, 01:25:12 pm ---You do realize, that instead of creating a "dummy"-Database (on Harddisk) as a workaround, you could use an "InMemory"-Database for that?

--- End quote ---

Please see the following posts, it emerges that it is not even necessary to create dummy databases, just do a Init/Release of the library.

Anyway thanks for the suggestion, even if I don't see a significant advantage in doing the dummy db in memory rather than on the filesystem.

Zvoni:

--- Quote from: Чебурашка on February 29, 2024, 01:25:23 pm ---Unfortunately InitializeSQLite is a deprecated method and therefore it might be removed in future.

--- End quote ---

Wrong!

Look closely
From sqlite3.inc

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function InitializeSqliteANSI(const LibraryName: AnsiString = ''): Integer; //needed as TLibraryLoadFunctionfunction InitializeSqlite(const LibraryName: UnicodeString = ''): Integer;function TryInitializeSqlite(const LibraryName: Unicodestring = ''): Integer;procedure ReleaseSqlite; //needed as TLibraryUnLoadFunction function InitialiseSQLite: Integer; deprecated;function InitialiseSQLite(const LibraryName: UnicodeString): Integer; deprecated; 

--- Quote ---function InitializeSqlite(const LibraryName: UnicodeString = ''): Integer;

function InitialiseSQLite: Integer; deprecated;
--- End quote ---

Чебурашка:

--- Quote from: Zvoni on February 29, 2024, 01:30:30 pm ---Wrong!

--- End quote ---

Thanks I didn't notice the difference, prob someone decided to force the American version, as for what I see British English uses also Initialise.

https://www.oxfordlearnersdictionaries.com/definition/english/initialize
https://www.wordreference.com/enit/initialize
https://dictionary.cambridge.org/it/dizionario/inglese/initialize

But Ok, lets not diverge from the topic, which is the most important thing for the fp-sqlite users

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version