Hello Stephen,

On Jun 11, 2004, at 12:18, Drew, Stephen wrote:

The problem with having separate pointers is that the threads themselves do
not have any idea of the database they will be using, which is wrapped in
shared classes. The threads are merely worker threads that do arbitrary
jobs.

I don't know about Windows APIs, since I work on Mac OS X, but...

One solution that comes to mind is caching the path to the database and a sqlite structure on a per-thread basis. So, the thread could be instructed to perform one or more actions on a given database file. In Cocoa (Mac OS X) I would do something like this:

[myThread performQuery: @"DROP TABLE someTable" withDatabase: @"~/myDBFile"];

This would:

1) attempt to open the file at the given path using its own sqlite structure (keep on trying while we get a SQLITE_BUSY error code)
2) execute the query
3) close the file


Would that work for you?

Optionally, there could be a performQueries method, accepting an array of strings containing the various SQL statements. Just an idea...

Regards,

-- Tito


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to