1) If shared, then the second threads insert is part of the transaction and should succeed. 2) No. 3) If the connection is shared between threads, there can only be 1 txn at a time. The second threads attempt to begin a txn will result in an error that indicates a txn is already active.
Shailesh Birari <[EMAIL PROTECTED]> wrote: Does anyone have any answers for the queries below? -Shailesh > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Shailesh Birari > Sent: Monday, April 14, 2008 9:55 PM > To: sqlite-users@sqlite.org > Subject: [sqlite] Transaction across threads > > Hello, > I had a doubt of sqlite transactions across threads. > I have a multithreaded application which shares the same > sqlite connection across threads. I had a few doubts > 1) If I do a begin transaction and insert on one thread. Then > do a insert on the second thread and finally a commit on the > first thread will the insert from the second thread succeed > or will it fail saying SQLITE_BUSY? if it succeeds, will the > insert on the second thread be a part of the transaction on > the first thread? > 2) When I do a Begin transaction will I get a transactionId? > 3) If one thread is in the middle of a transaction and > another thread does a begin transaction, will it be able to > start its own transaction or will it fail with SQLITE_BUSY.? > > Kindly let me know, > > Regards, > Shailesh. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users