chickadee » sqlite3 » set-busy-handler!

set-busy-handler! DATABASE PROCprocedure

Installs the supplied procedure as the application's busy handler, or removes it if #f. When the database returns a busy error code, the egg will invoke this handler repeatedly until it returns #f. The handler will be called with arguments DATABASE and COUNT (number of times invoked for the same operation).

As PROC is not called in a callback context, it is legal to invoke captured continuations, and it is safe in the presence of multiple threads. In general, this handler should give up at some point to avoid possible deadlock.

For an example handler, see the code of make-busy-timeout.