PHP@プログラム板 at TECH
[2ch|▼Menu]
262:デフォルトの名無しさん
09/02/16 21:37:48
URLリンク(www.mail-archive.com)
[sqlite] "Database is locked" error in PHP via PDO despite setting timeout
Sun, 19 Mar 2006 11:15:50 -0800

I'm using Sqlite3 from PHP via PDO.

My application was working fine as long as there was only one process
accessing the database, then I ran two instances at once. Now one of the
processes is getting

"Error message: SQLSTATE[HY000]: General error: 5 database is locked"

when trying to execute a statement which modifies the database.

I understand that this is liable to happen, unless a timeout is set via
sqlite3_busy_timeout().

I have set this timeout using the $db->setAttribute(PDO::ATTR_TIMEOUT, 5.0)
however it's made absolutely no difference to the behaviour.

It's certainly not waiting 5 seconds before giving me this error, and it's
happening with exactly the same frequency as before. It's as if it's being
ignored.

I've stepped through PHP in the debugger (gdb) and it's definitely calling
sqlite3_busy_timeout with the appropriate parameters (5000 ms).

What else can I do to prevent this?

If the answer is "nothing", I'm going straight over to MySQL :)

Mark


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5499日前に更新/165 KB
担当:undef