Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-19 Thread Michael Ekstrand
Dennis Cote wrote: What happens to the ROWID when the transaction is rolled back? Is it as if the record with that ROWID was deleted? Yes If I understand it correctly, connection C1 can do an INSERT, get ROWID 4, C2 does an INSERT, gets 5, and commits, and then C1 commits, with its 4; if

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-19 Thread Dennis Cote
Michael Ekstrand wrote: [EMAIL PROTECTED] wrote: The ROWID is generated after the BEFORE triggers fire and before the row is inserted. OK, I think I'm getting it. The INSERT statement generates the ROWID, fires triggers, then inserts the row. When the transaction is committed, all

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread Michael Ekstrand
[EMAIL PROTECTED] wrote: The ROWID is generated after the BEFORE triggers fire and before the row is inserted. OK, I think I'm getting it. The INSERT statement generates the ROWID, fires triggers, then inserts the row. When the transaction is committed, all that is committed; when the

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread drh
Michael Ekstrand <[EMAIL PROTECTED]> wrote: > Will Leshner wrote: > > On 4/17/06, Michael Ekstrand <[EMAIL PROTECTED]> wrote: > > > >> 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. > > >

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-18 Thread Michael Ekstrand
Will Leshner wrote: On 4/17/06, Michael Ekstrand <[EMAIL PROTECTED]> wrote: 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. The last insert id is a property of a connection. So there is no way

Re: [sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-17 Thread Will Leshner
On 4/17/06, Michael Ekstrand <[EMAIL PROTECTED]> wrote: > 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. The last insert id is a property of a connection. So there is no way that one connection

[sqlite] Transactions and sqlite3_last_insert_rowid

2006-04-17 Thread Michael Ekstrand
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