handling for busy-errors
Status: Alpha
Brought to you by:
bfleisch
Hi,
I have implemented the handling for busy-errors during sqlite calls (i.e., if database is locked). My patch lets the process randomly wait for 50 - 200,000 microseconds before retrying.
This has been tested on FreeBSD only, but hopefully it will work across all systems (theoretically, I don't see any reason why not).
Regards,
[ simon.cpu ]
patch for php_sqlite3.c
Logged In: YES
user_id=378627
Originator: NO
Waaah... I forgot to login :)
[ simon.cpu ]
Logged In: YES
user_id=378627
Originator: NO
--- php_sqlite3.h.org Mon Nov 20 06:41:31 2006
+++ php_sqlite3.h Mon Nov 20 05:21:23 2006
@@ -39,12 +39,12 @@
PHP_FUNCTION(sqlite3_create_function);
-
#define PHP_SQLITE3_FETCH_ASSOC 1
#define PHP_SQLITE3_FETCH_INDEX 2
-
-
+#define WAIT_RAND_LO 50
+#define WAIT_RAND_HI 200000
+#define WAIT_MAX 30
extern zend_module_entry sqlite3_module_entry;
#define phpext_sqlite3_ptr &sqlite3_module_entry
Logged In: YES
user_id=378627
Originator: NO
That was the patch for php_sqlite3.h. =)
/me wacks his head for being so forgetful...