forgive my not understanding this but i'm trying to be extremely clear and i am not sure from your answer whether you have understood my question.
> In SQLite every write is in a transaction whether you declare one with BEGIN > or not. If you don't declare a transaction, SQLite invisibly surrounds each > individual INSERT or UPDATE with a BEGIN and COMMIT. sure, that's fine. but if you do your own BEGIN, then any INSERT you do after that, *before* you do the COMMIT isn't actually writing anything into the database, right? it's really only the COMMIT that actually writes to the database, right? >> i understand that one commit will block the other >> >> but does inserting data during a transaction actually block too? > > It is each transaction which blocks each other transaction, but the default > behaviour is not to lock the file until the first command that makes a > change. So once one thread has executed an INSERT, all other threads will be > blocked at their own BEGINs and will never even get to do an INSERT until the > first thread has done its COMMIT. but you're not addressing the case where i have manually started a BEGIN. after i manually do BEGIN, does the next INSERT need to block, or is it the COMMIT that actually does the blocking? do you see what i'm asking? >> is inserting considered a "writing transaction" if there is a "begin" before >> it? cuz it's not actually writing to the DB proper, it's writing to it's >> journal file, saving things up until the "commit" or "rollback". > > The natural question you're asking is something like "Well, if each thread is > just inserting new rows, why do they need to block each-other ? They don't > care what data the other threads are inserting." well, i would phrase it this way: "if each thread is collecting several rows that it will insert in one fell swoop, why should the mere gathering of rows (without actually committing them yet) block another thread from gathering it's own set of rows? it's only when all the rows are gathered that i actually commit the change. Since the database isn't being written to during the gathering phase, they don't care what other threads are gathering". am i making sense? _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

