javascript - db issue on reboot in IOS + cordova + app development -


i creating app in ios cordova 2.1.0 framework. database files copied in /iphone simulator/6.0/applications/782be659-4ce2-4a10-941d-32de404483e6/library/caches folder. have following code in index.html:

dbname = 'database'; gappconfig.dbmessage =  'message demo'; db = window.opendatabase(dbname, "1.0", gappconfig.dbmessage, 200000);  db.transaction(queryselectconfig, errorquery);  //get messages db function queryselectconfig(tx) {     alert('select config')    tx.executesql('select * '+gappconfig.configtable, [], queryselectsuccess, errorquery);  }  

function queryselectsuccess() called when query successful, otherwise errorquery() function gets called.

so, when app executed first time, query works fine. while, when reboot simulator or device, above query fails , errorquery() function gets called. in native objective-c code, copying db files path mentioned above (where phonegap tries find db) before index.html loaded. db initialization(copying of db files in mentioned path) happens first time ie. on reboot does'nt happen db files exist in mentioned location. why query failing on reboot. appreciated.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -