Menu

#1 handling for busy-errors

open
nobody
None
5
2006-11-22
2006-11-22
Anonymous
No

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 ]

Discussion

  • Nobody/Anonymous

    patch for php_sqlite3.c

     
  • simoncpu

    simoncpu - 2006-11-22

    Logged In: YES
    user_id=378627
    Originator: NO

    Waaah... I forgot to login :)

    [ simon.cpu ]

     
  • simoncpu

    simoncpu - 2006-11-22

    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

     
  • simoncpu

    simoncpu - 2006-11-22

    Logged In: YES
    user_id=378627
    Originator: NO

    That was the patch for php_sqlite3.h. =)

    /me wacks his head for being so forgetful...

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.