Re: [sqlite] Understanding transactions

2014-02-05 Thread Dan Kennedy
On 02/04/2014 10:12 PM, Igor Tandetnik wrote: On 2/4/2014 5:23 AM, Yuriy Kaminskiy wrote: How sqlite is supposed to behave when *) there are read-only transaction; *) there are update transaction on other connection; *) cache space is exhausted by update transaction; *) sqlite was not able to

Re: [sqlite] Understanding transactions

2014-02-04 Thread Igor Tandetnik
On 2/4/2014 6:43 PM, Yuriy Kaminskiy wrote: I've checked on 3.8.2, 3.8.1, 3.7.14, 3.7.7; results was exactly same. I've added sqlite3_libversion() output, and it matches expected version in all cases. This is on linux/i386/32-bit. Well, 3.5.9 on Windows 7 works to spec. That's all I know. You

Re: [sqlite] Understanding transactions

2014-02-04 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > On 2/4/2014 5:51 PM, Yuriy Kaminskiy wrote: >> Igor Tandetnik wrote: >>> On 2/4/2014 11:57 AM, Yuriy Kaminskiy wrote: Phew. Do you speak C? Enjoy. printf("insert...\r"); fflush(stdout); for(i = 0; i < 1000; i++) { rc =

Re: [sqlite] Understanding transactions

2014-02-04 Thread Igor Tandetnik
On 2/4/2014 5:51 PM, Yuriy Kaminskiy wrote: Igor Tandetnik wrote: On 2/4/2014 11:57 AM, Yuriy Kaminskiy wrote: Phew. Do you speak C? Enjoy. printf("insert...\r"); fflush(stdout); for(i = 0; i < 1000; i++) { rc = sqlite3_bind_int(ins_sth, 1, i); assert(rc == SQLITE_OK);

Re: [sqlite] Understanding transactions

2014-02-04 Thread Simon Slavin
On 4 Feb 2014, at 8:49pm, Igor Tandetnik wrote: > If it is unable to promote the lock, then the in-memory cache will be left in > an inconsistent state and so the error code is promoted from the relatively > benign SQLITE_BUSY to the more severe SQLITE_IOERR_BLOCKED. This

Re: [sqlite] Understanding transactions

2014-02-04 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > On 2/4/2014 11:57 AM, Yuriy Kaminskiy wrote: >> Phew. Do you speak C? Enjoy. >> >> printf("insert...\r"); fflush(stdout); >> for(i = 0; i < 1000; i++) { >> rc = sqlite3_bind_int(ins_sth, 1, i); >> assert(rc == SQLITE_OK); >> rc = sqlite3_step(ins_sth);

Re: [sqlite] Understanding transactions

2014-02-04 Thread Igor Tandetnik
On 2/4/2014 11:57 AM, Yuriy Kaminskiy wrote: Phew. Do you speak C? Enjoy. printf("insert...\r"); fflush(stdout); for(i = 0; i < 1000; i++) { rc = sqlite3_bind_int(ins_sth, 1, i); assert(rc == SQLITE_OK); rc = sqlite3_step(ins_sth); assert(rc ==

Re: [sqlite] Understanding transactions

2014-02-04 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > On 2/4/2014 5:23 AM, Yuriy Kaminskiy wrote: >> How sqlite is supposed to behave when >> *) there are read-only transaction; >> *) there are update transaction on other connection; >> *) cache space is exhausted by update transaction; >> *) sqlite was not able to upgrade

Re: [sqlite] Understanding transactions

2014-02-04 Thread Igor Tandetnik
On 2/4/2014 5:23 AM, Yuriy Kaminskiy wrote: How sqlite is supposed to behave when *) there are read-only transaction; *) there are update transaction on other connection; *) cache space is exhausted by update transaction; *) sqlite was not able to upgrade RESERVED lock to EXCLUSIVE due to

Re: [sqlite] Understanding transactions

2014-02-04 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > On 2/3/2014 3:21 PM, Yuriy Kaminskiy wrote: >> Igor Tandetnik wrote: >>> On 2/3/2014 1:07 PM, Baruch Burstein wrote: 1) How does a transaction affect SELECTs? If I start a transaction and do an UPDATE/DELETE/INSERT, what data will a SELECT in the same

Re: [sqlite] Understanding transactions

2014-02-03 Thread Igor Tandetnik
On 2/3/2014 3:21 PM, Yuriy Kaminskiy wrote: Igor Tandetnik wrote: On 2/3/2014 1:07 PM, Baruch Burstein wrote: 1) How does a transaction affect SELECTs? If I start a transaction and do an UPDATE/DELETE/INSERT, what data will a SELECT in the same transaction see? The new data. A transaction

Re: [sqlite] Understanding transactions

2014-02-03 Thread Yuriy Kaminskiy
Igor Tandetnik wrote: > On 2/3/2014 1:07 PM, Baruch Burstein wrote: >> 1) How does a transaction affect SELECTs? If I start a transaction and do >> an UPDATE/DELETE/INSERT, what data will a SELECT in the same transaction >> see? > > The new data. A transaction always sees its own changes. > >>

Re: [sqlite] Understanding transactions

2014-02-03 Thread Simon Slavin
On 3 Feb 2014, at 7:51pm, Baruch Burstein wrote: > Thank you for the explanations. If I wrap a few SELECTs in a transaction, > does this guarantee that the data I read will be consistent across all of > the SELECTs? Yes. Unless the same connection that is doing all these

Re: [sqlite] Understanding transactions

2014-02-03 Thread Baruch Burstein
Thank you for the explanations. If I wrap a few SELECTs in a transaction, does this guarantee that the data I read will be consistent across all of the SELECTs? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list

Re: [sqlite] Understanding transactions

2014-02-03 Thread Igor Tandetnik
On 2/3/2014 2:04 PM, Simon Slavin wrote: 1) How does a transaction affect SELECTs? If I start a transaction and do an UPDATE/DELETE/INSERT, what data will a SELECT in the same transaction see? You can change it ... A transaction

Re: [sqlite] Understanding transactions

2014-02-03 Thread Igor Tandetnik
On 2/3/2014 1:07 PM, Baruch Burstein wrote: 1) How does a transaction affect SELECTs? If I start a transaction and do an UPDATE/DELETE/INSERT, what data will a SELECT in the same transaction see? The new data. A transaction always sees its own changes. What about a SELECT in a different

Re: [sqlite] Understanding transactions

2014-02-03 Thread Simon Slavin
On 3 Feb 2014, at 6:07pm, Baruch Burstein wrote: > I am a little unclear on some of the ways transactions affect multiple > connections. I am assuming that multiple sqlite3 objects in one program is > the same as multiple programs. Wanted to check whether you'd read this,