> It will retry the EXCLUSIVE lock each time a page that is not > in the cache is required by SQLite (a "cache-miss").
If SQLite doesn't require to read any pages but only adds new pages to the file does it count as cache-miss? Pavel On Fri, May 28, 2010 at 1:41 AM, Dan Kennedy <danielk1...@gmail.com> wrote: > > On May 27, 2010, at 8:07 PM, Pavel Ivanov wrote: > >>> That's true, except for the case when exclusive lock fails; at >>> least that's >>> what Dan Kennedy says to my question from a couple of years ago: >>> http://old.nabble.com/changes-in-cache-spill-locking-since-3.5.9--td20564357.html#a20564357 >> >> It's interesting feature, I didn't know about that. It would be also >> useful to know will acquiring of EXCLUSIVE lock be re-attempted after >> failure at some point during this transaction with indefinite cache >> growing? If yes then how often SQLite will retry? > > It will retry the EXCLUSIVE lock each time a page that is not > in the cache is required by SQLite (a "cache-miss"). > > Since at this point SQLite has a PENDING lock on the database, > no new readers can connect. So once all existing readers have > finished, the writer will be able to upgrade to an EXCLUSIVE > and free memory by writing dirty pages to the db file. In other > words, the cache will not continue growing after the readers > have unlocked the database. > > Dan. > > > > >> On Thu, May 27, 2010 at 8:48 AM, Igor Sereda <ser...@gmail.com> wrote: >>> >>> Pavel, >>> >>> Thanks for the reply! I was afraid using pcache would be the only >>> way :) >>> >>> As for this: >>> >>> Pavel Ivanov-2 wrote: >>>> >>>> No way. Cache won't ever grow just because you have large >>>> transaction. >>>> It will only be spilled to disk and exclusive lock will be taken but >>>> never trigger unbound growth. >>>> >>> >>> That's true, except for the case when exclusive lock fails; at >>> least that's >>> what Dan Kennedy says to my question from a couple of years ago: >>> http://old.nabble.com/changes-in-cache-spill-locking-since-3.5.9--td20564357.html#a20564357 >>> >>> I guess that's an undocumented feature. >>> >>> Cheers, >>> Igor >>> -- >>> View this message in context: >>> http://old.nabble.com/Using-cache-stats-to-balance-transaction-size-for-optimal-performance-tp28690967p28693594.html >>> Sent from the SQLite mailing list archive at Nabble.com. >>> >>> _______________________________________________ >>> 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 > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users