From george.shimanovich at indexengines.com Tue Jul 11 20:51:11 2017 From: george.shimanovich at indexengines.com (George Shimanovich) Date: Tue, 11 Jul 2017 20:51:11 +0000 Subject: [DBD-SQLite] adding support ot busy handler support in DBD::SQLite Message-ID: Hello, Current implementation of DBD::SQLite supports busy timeout (sqlite_busy_timeout), but not busy handler. sqlite3's busy handler (sqlite3_busy_handler) offers alternative way to deal with busy timeout (sqlite3_busy_timeout). For example, it allows one to implement infinite busy timeout with a callback used to identify (e.g. once a minute) process holder of write lock to the database. With busy timeout the caller needs to implement retry logic for every query, which is cumbersome. Are there plans to add support to busy handler? I am thinking of implementing driver private method sqlite_busy_handler and will welcome any insights. Perhaps I am missing something. I considered using sqlite_progress_handler but can't implement the above busy handler functionality using it, as there is no way to determine that database is busy. Plus sleeping in progress handler defeats its purpose and causes delay. Thank you, George -------------- next part -------------- An HTML attachment was scrubbed... URL: From kishigaki at gmail.com Wed Jul 12 06:26:02 2017 From: kishigaki at gmail.com (Kenichi Ishigaki) Date: Wed, 12 Jul 2017 15:26:02 +0900 Subject: [DBD-SQLite] adding support ot busy handler support in DBD::SQLite In-Reply-To: References: Message-ID: Hi 2017-07-12 5:51 GMT+09:00 George Shimanovich : > Hello, > > > Current implementation of DBD::SQLite supports busy timeout > (sqlite_busy_timeout), but not busy handler. > > > sqlite3's busy handler (sqlite3_busy_handler) offers alternative way to deal > with busy timeout (sqlite3_busy_timeout). > > For example, it allows one to implement infinite busy timeout with a > callback used to identify (e.g. once a minute) process holder of write lock > to the database. With busy timeout the caller needs to implement retry logic > for every query, which is cumbersome. > > > Are there plans to add support to busy handler? > > > I am thinking of implementing driver private method sqlite_busy_handler and > will welcome any insights. Perhaps I am missing something. > Pull requests are always welcome :) Cheers, Kenichi > > I considered using sqlite_progress_handler but can't implement the above > busy handler functionality using it, as there is no way to determine that > database is busy. Plus sleeping in progress handler defeats its purpose and > causes delay. > > > Thank you, > > George > > > _______________________________________________ > DBD-SQLite mailing list > DBD-SQLite at lists.scsys.co.uk > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbd-sqlite >