On Wed, Jan 19, 2011 at 12:35 PM, James Berry <ja...@jberry.us> wrote:
> I'm trying to understand whether there's any problem with committing a > transaction while in the process of stepping over results. > > The following loop, in some kind of weird hybrid pseudo-code, tries to > illustrate what I'm doing: while stepping over results from a select > statement, doing inserts into another table. During that process, I want to > break up the current transaction. > > Is there any effect on the outer select/step by committing and restarting > the transaction while the outer statement is still being used? (In my actual > use-case, the inner commit/begin is not performed on every iteration). > > The codes seems to be working for me, but I want to make sure it's not > working in the realm of undefined operation. > The ability to do this was added to SQLite in version 3.6.5 in November of 2008. > > James > > > BEGIN DEFERRED TRANSACTION > > SELECT * FROM a > sqlite3_step over select results > { > COMMIT > BEGIN DEFERRED TRANSACTION > > INSERT INTO b > } > > COMMIT > > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users