> > Despite what the sqlite wiki says, I think sqlite3_finalize now works
> > from another thread as long as nothing else is using that sqlite3
> > connection or any prepared statements on that connection. Of course,
> > I could be wrong.
>
> Even if you are not wrong this still means that what driver does is
> illegal. A call to sqlite3_finalize from java's finalize may appear
> while some other statement is already executing. Or finalize may be
> never called. Releasing memory in JDBC's close methods should be good
> enough.
Ignore what I wrote about references and finalizers -
I just noticed that all sqlite_* methods are synchronized in both the
NativeDB and NestedDB wrapper classes:
NestedDB:
protected synchronized int finalize(long stmt) throws SQLException {
return call("sqlite3_finalize", (int)stmt); }
...
NativeDB:
protected native synchronized int finalize(long stmt);
So all database actions on any thread appear to be serialized against
the DB instance. A PrepStmt should be able to be finalized in any thread
without a problem.
____________________________________________________________________________________Yahoo!
oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SQLiteJDBC" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlitejdbc?hl=en
-~----------~----~----~----~------~----~------~--~---