I'm trying to figure out how sqlite3_last_insert_rowid() interacts with
transactions.

I've read the thread at
http://www.mail-archive.com/sqlite-users@sqlite.org/msg13393.html

However, the concern raised in the last message of that thread is
exactly my concern, and was never addressed in the context of that
thread (or elsewhere, as far as I can see).  What happens when I do a
bunch of inserts in a transaction (possibly DEFERRED), and another
process completes an insert before I commit? Can any of my ROWID's be
affected/changed?

The documentation seems slightly ambiguous as to whether the
last_insert_rowid will be from the last committed insert, or last insert
sent to the server.  I haven't been able to find a positive statement to
the effect of "yes, last_insert_rowid invariably returns the ROWID from
the last insert statment, even if its transaction has not yet been
comitted."

So, if someone could enlighten me as to the defined behavior of
sqlite3_last_insert_rowid with regards to transactions, I would be most
grateful.

TIA,
- Michael

-- 
mouse, n: a device for pointing at the xterm in which you want to type.
                -- Fortune
Visit me on the Web: http://www.elehack.net

Reply via email to