PHP 7.0.0 Beta 2 Released


(PHP 5 >= 5.3.3)

SQLite3::busyTimeoutSets the busy connection handler


public bool SQLite3::busyTimeout ( int $msecs )

Sets a busy handler that will sleep until the database is not locked or the timeout is reached.

Elenco dei parametri


The milliseconds to sleep. Setting this value to a value less than or equal to zero, will turn off an already set timeout handler.

Valori restituiti

Returns TRUE on success, FALSE on failure.

add a note add a note

User Contributed Notes 1 note

ppryor63 at gmail dot com
1 year ago
The busyTimeout() method and related API sqlite3_busy_timeout() is a connection level attribute and affects whole connection and should be set once after opening connection.  Do not set to zero or you will encounter "Database is busy" error message when calling query, querySingle, prepare, or execute methods.  Also ensure that sqlite3 library is compiled with HAVE_USLEEP defined, otherwise busyTimeout() can only time out in seconds.  It is very highly recommended to call busyTimeout() with non-zero timeout for reliability in concurrent environment.
To Top