Possible threadsafe conflict in Windows

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Possible threadsafe conflict in Windows

David Gewirtz

I've started writing my first wrappers for SQLite compiled inside the
Frontier Kernel and I've run into a snag. I have one verb that calls
sqlite3_open. It returns successfully and sets the db properly. If, in that
same routine, I call sqlite3_close, it works successfully.

But, if I return from that verb and then call sqlite3_close in a separate
verb (all in the same thread), I get the "library routine called out of
sequence" error.

I'm building this on Windows (VC2K3) and everything else seems fine. I've
read about this problem occuring with a THREADSAFE conflict, but I can't
tell if I should disable threadsafe (or if I even can, in Windows) or if I'm
missing something else.

Any help would be appreciated. Thanks!


-- David

Reply | Threaded
Open this post in threaded view
|

Re: Possible threadsafe conflict in Windows

Teg-3
Hello David,

So, what do you see when you use the debugger? I use multi-threads
with SQLite in window using VC6 and don't have any problems like that
so, I'd be looking for programming problems. Look at the value of the
pointer you get back from open and make sure it's the same one you
pass to close.

I compiled SQlite3 into my program so, in debug mode I can step right
into the library and see what SQLite thinks.

C



Friday, March 17, 2006, 5:09:05 PM, you wrote:


DG> I've started writing my first wrappers for SQLite compiled inside the
DG> Frontier Kernel and I've run into a snag. I have one verb that calls
DG> sqlite3_open. It returns successfully and sets the db properly. If, in that
DG> same routine, I call sqlite3_close, it works successfully.

DG> But, if I return from that verb and then call sqlite3_close in a separate
DG> verb (all in the same thread), I get the "library routine called out of
DG> sequence" error.

DG> I'm building this on Windows (VC2K3) and everything else seems fine. I've
DG> read about this problem occuring with a THREADSAFE conflict, but I can't
DG> tell if I should disable threadsafe (or if I even can, in Windows) or if I'm
DG> missing something else.

DG> Any help would be appreciated. Thanks!


DG> -- David




--
Best regards,
 Teg                            mailto:[hidden email]