From: Jamis Buck Date: 2005-10-25T01:25:46+09:00 Subject: Re: sqlite3 busy_handler I'm afraid I have no idea whether the busy-handler callback actually works or not. It was one of those things that I implemented because it was in the SQLite3 API, but I didn't have a good way to unit test it. - Jamis On Oct 24, 2005, at 9:53 AM, Ruby Newbie wrote: > Having trouble getting the sqlite3 busy_handler to work. The > documentation > at http://sqlite-ruby.rubyforge.org/sqlite3/ lists *busy_handler* > ( data=nil > ) {|data, retries| ...} as the public instance method. So far I've > tried > > Class DbHandler > print "in DbHandler\n" > def busy_handler(*data) > print "in DbHandler.busy_handler\n" > return true; > end > end > > and registering using > db = SQLite3::Database.new(....) > db.busy_handler(DbHandler) > > as well as > handler = DbHandler.new > db.busy_handler(handler) > > as well as > db.busy_handler(handler.busy_handler(data=nil,retries=nil)) > > My first attempt with a method named busy_handler outside of a > separate > class was no better. > > The code compiles and runs, but two separate processes running in > parallel > will lock the database - when I would expect them to both run > indefinitely > since I am never returning false from the busy_handler method I'm > trying to > invoke. > > Any ideas? >