Am 19.04.2006 um 15:31 schrieb [EMAIL PROTECTED]:

Felix Schwarz <[EMAIL PROTECTED]> wrote:
Hi,

I have just discovered these old message on the SQLite Yahoo! Group:

http://groups.yahoo.com/group/sqlite/message/2115
http://groups.yahoo.com/group/sqlite/message/2117

This does sound very interesting! If I simply want to store binary
data that I want to access via an index number again (and do this
real quick), how big is the difference between using SQLite or its
btree functions directly?


I'm guessing that you will not see a significant performance
improvement over using prepared statements in the SQL interface
and a table like this:

   CREATE TABLE storage(
     id INTEGER PRIMARY KEY,
     data BLOB
   );

Thank you very much. Regarding the structure, that's exactly what I had in mind.

I've now started to extend my SQL wrapper classes to support caching of prepared statements. This has, however, raised a question for me regarding an edge case:

I might have to call sqlite3_finalize() on a thread different from the one the initial sqlite3_prepare() call took place. My classes take care that there's one sqlite3-connection per thread, so the sqlite3-connection used with the initial sqlite3_prepare() call has also been opened on that other thread.

Example:
Thread A opens sqlite3-connection connA
Thread A prepares a statement stA using sqlite3_prepare() using the connection connA
Thread B calls sqlite3_finalize on statement stA

Is this a safe operation to do?

Thanks again.

Felix

Reply via email to