Enrique Ramirez <[EMAIL PROTECTED]> wrote: > I've been working on DBMS systems for a couple of years now (namely > MS-SQL and MySQL) and I find SQLite's usage of transactions to be > quite unique and interesting. I've been reading on different websites > about them and one particular site (which sadly I can't remember) > confused me a bit. They were recommending that transactions be used > even on select statements if they were consecutive.
There's nothing specific to SQLite there, the same is true for any DBMS. But not just when two statemetns are consecutive - when you want two consecutive statements to return consistent results. E.g if you run "select count(*) from myTable" twice in a row outside a transaction, you may get different results. If you run the two within a single transaction, you are guaranteed the same result. Sometimes the consistency between two selects is important. > My questions are then, > 1) is this correct? That transactions are only ever useful when making changes? No, this is incorrect. They are also useful for preventing somebody else from making changes while you are in the middle of reading. > 2) if no changes are being made to the database, what is being > commited? Nothing. Why do you believe something necessarily must be? 3) is the 'optimization' coming from preventing SQLite from > generating a new transaction for each query? What 'optimization'? > And an off-topic question if I may, is there a way to browse through > archives of older mailings? http://www.mail-archive.com/[email protected] http://news.gmane.org/gmane.comp.db.sqlite.general http://www.nabble.com/SQLite-f797.html Igor Tandetnik _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

