|
Post by vann1p on Sept 9, 2020 14:51:46 GMT
Hi! I'm using SimpleSQLite in a Unity application (not a game) that relies on using background threads to perform some of the required functionalities. Like other users of the asset that asked for support on this board, i'm experiencing crashes caused by calling SimpleSQL APIs from multiple threads. Starting from some investigations made by another user on this forum, like echo17.proboards.com/post/346/thread, i came to know that SQLite supports multi-threaded access by configuration via some API provided by SQLite 3 through its C interface. (refs: www.sqlite.org/threadsafe.html and www.sqlite.org/c3ref/config.html)I was wondering about the chance to have an API (or feature in the Editor) to configure that particular option, since it must be configured before initialization and/or after closing (SQLite error code 21 is thrown if done otherwise). Calling the SimpleSQL.SQLite3.Config(configOption) always yields SQLite result error 21, no matter if called before SimpleSQLManager.initialize(bool) or after SimpleSQLManager.Close(). To directly call the underneath bridged API requires a pointer/handle to the db as an argument which i was un-successful to obtain. Will it be possibile to open a discussion for such a feature? I'm available for collaboration on development and/or testing and i'm pretty sure that would be useful for many others. Thanks!
|
|
|
Post by echo17 on Sept 10, 2020 12:39:34 GMT
Thanks for the suggestion, it does sound like a good feature to include in the future. I have not experimented with multi-threading with sqlite so it would take some research on my part to determine how feasible it would be in the Unity environment.
In the meantime, the source code is included with the plugin, so feel free to modify and experiment. You may find a solution that meets your needs much faster that way.
|
|