i got following contradictory replies to my question

> if i execute query like " insert into tbl( filed ) VALUES ( 1 ); Select
> last_insert_rowid() as li;" would be it atomic? or  it anyway would suffer
> from threads?

from borgan:
> Hi, i think this will probably be "atomic".
> What i mean is the transaction will aquire EXCLUSIVE lock (because of
> the insert command) and it will keep this lock until commit, which
> takes place after the last select and last semicolon.
>
> So i believe no other threads should be able to do anything with your
> db until the whole query finishes.
and from Kees Nuyt:
> The last_insert_rowid() function returns the ROWID of the last row
> insert from the database connection which invoked the function.
> So, yes, it suffers from threads if the threads use the same
> database connection.

whom to trust?

as for Kees Nuyt reply, did you toke int account that "select 
last_insert_rowid() "
and insert query combined in single query and executed via single call 
of sqlite3_exec()?

BR, RM
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to