Hi David,

I understand that SQLite does not support concurrent writes but I am
not trying to write to the database at all. I am seeing this problem
with two select statements, i.e.

    rs = conn1.prepareStatement("select * from x;").executeQuery();
    rs.next();
    conn2.prepareStatement("select * from y;").executeQuery();

but again only when running as a servlet in Tomcat. I'm sure it is
difficult to test an application which you are not familiar with but
this does look like a defect in the nested Java JDBC driver to me as
the SAME code works when using the native windows driver.

Sam


On Mar 7, 8:44 pm, "David Crawshaw" <[EMAIL PROTECTED]> wrote:
> >  It would be great to see a fix for this in the next release David or
> >  an explanation as to why it doesn't work.
>
> You're using programs I have no experience with and I do not have the
> time to learn. But I can guess:
>
>     SQLite does not support concurrent writes.
>
> You can do this with server-based DBMSs (such as MySQL, PostgreSQL, MS
> SQL, Oracle, etc);
>
>     rs = conn1.prepareStatement("select * from x;").executeQuery();
>     rs.next();
>     conn2.prepareStatement("insert into y ...").executeUpdate();
>
> You cannot do this with SQLite. The thread with conn2 will block until
> conn1 closes its select statement. If more than 3000ms passes, conn2
> will throw a "db is locked". Sloppy code leaves selects open for the
> long term in some threads, because they're used to a DBMS do the dirty
> work for them. I suspect that is what is happening here. When someone
> is writing to the file, no-one can be reading it.
>
> d.
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to