busyCallBack



The busyCallBack method is an example of a user callback method for the busyHandler method. Here the method name of busyCallBack is used, because it is the default method name if the programmer does not specify his own name in the busyHandler method. Any method name can be used by specifying it as the second argument to busyHandler.

Note: there is no busyCallBack method in any ooSQLite class. This method is just used to illustrate how to define a user callback method to be used as a busy handler.

Arguments: The arguments sent to the callback method are:
countInvoked [required] The number of times that the busy handler has been invoked for this locking event.
userData [optional] The user data object specified by the programmer as the third argument to thebusyHandlermethod. If the programmer did not specify a user data argument, this argument is omitted when the callback is invoked.
Return value: The programmer must return a value from the callback. If the method returns 0, then no additional attempts are made to access the database by the SQLite database engine and SQLITE_BUSY or SQLITE_IOERR_BLOCKED is returned. If the callback returns non-zero, then another attempt is made to open the database for reading and the cycle repeats.
Details: The implementation of abusy handlermethod is is discussed on the SQLite sqlite3_busy_handler page.