On Thu, Apr 05, 2012 at 07:29:48PM +0200, Andreas Wiencke scratched on the wall: > >> In my code I want to read from one table and write the results to > >> another table. But if I don't fetch all the results and close the > >> reading connection, I cannot write to another table in the same > >> database. > > > > ??Do it all from the same connection. ??The locks are "owned" by a > > ??database connection, so opening a second connection won't work, even > > ??if they're within the same process. > > > > ??You should, however, be able to run both the query and the inserts > > ??from the same connection without issues, even if they're intermixed. > > Thanks for all the answers! I know how to solve this problem now. But > there is one thing that is still unclear to me: > why did this work in SQlite2? Was Version 2 unsafe when executing such > a pattern?
SQLite2 was a long time ago-- longer than I've been involved with SQLite. That said, from what I remember hearing, SQLite2 only supported the "_exec()" style interface. If I followed the thread correctly, at least part of the issue in this situation was that the first statement was not finalized correctly, releasing the locks. That situation couldn't have existed in SQLite2, as I understand it did not support the prepare/step/finalize style APIs. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users