Hello, all,
First, I apologize if the list has received multiple copies of e-
mails from me. I'm using gmail, and gmail does strange things to e-
mails when receiving through a POP client an e-mail that is from your
own account. If anyone at all gets this, please reply to me
personally, even if to say, "yes, I got your e-mail, even though your
copy from the mailing list isn't getting to you." I don't mind my
inbox being flooded ;-) I had tried to post a multi-threading
question before, but 1) I never got the e-mail back (gmail is
strange), and 2) I never saw a reply (perhaps the e-mail never got to
you.)
Second, my question is about SQLite and multi-threading. Basically,
the snippet below means that if I have multiple threads executing SQL
statements, and I want at least one thread to execute multiple SQL
statements as a single unit, I need to make sure only one thread at a
time is executing SQL, or the SQL statements that are outside of the
thread may get lumped in with the transaction. As in,
10. thread 1: shut off auto commit
20. thread 1: SQL statement 1 succeeds
30. thread 2: independent SQL statement succeeds
40. thread 1: SQL statement 2 fails
50. thread 1: rollback, taking with it thread 2's effect
If that's the case, it also answers my previous, unposted question
about sqlite3_changes, which was, "what would sqlite3_changes return
if it were called at line 35 in the above sequence?"
Regards,
Don Lavelle
On Nov 8, 2007, at 9:23 AM, Salles, Joaquim Campos wrote:
I found two e-mails (bellow) that I think give the answer: yes is safe
to use the same database connection, but is not work in the way that I
imagined. "Transaction control is per connection, not per
thread." (Igor
Tandetnik) or "That connection can then be used across threads, but it
is for all intents and purposes a single line of communication with a
database (using it twice at the same time doesn't somehow multiply
that
relationship)". (Stephan Beal)
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------