php - SQLite Alternatives -
i looking alternative sqlite. have application has lighttpd built , serves php scripts interact multiple instances of application. architectural questions aside, reason, person wrote chose use sqlite database php scripts -- store , retrieve information scripts themselves. such, appears have locking issues. deal programmer used stuff this:
$executed = $storedb->exec($updatesql); while($executed === false && $i<10) { $storedb->close(); $storedb = new sqlite3('c:/path/path2/lighttpd/store.db'); $pragmadb = "pragma journal_mode=wal"; ($storedb->exec($pragmadb)); $executed = $storedb->exec($updatesql); $i++; }
i understand why sqlite chosen can copied on , over, not need installed server, , small. however, multiple instances of application hitting php scripts, concurrently, can see causing problems: information retrieval operations fail , data not updated. warnings in log this.
an update statement
[07-mar-2015 21:03:44 utc] php warning: sqlite3::exec(): database locked in c:\path\path2\lighttpd\htdocs\processrequest.php on line 194
and
a select statement
[07-mar-2015 21:22:25 utc] php warning: sqlite3::query(): unable prepare statement: 5, database locked in c:\path\path2\lighttpd\htdocs\processrequest.php on line 151
i of ask, have comparable alternatives sqlite situation? listed reasons chosen begin with, primary need able copied, though can around if necessary.
if can afford wait lock clear, can use sqlite busy timeout.
Comments
Post a Comment