0

I am developing an Android App using PhoneGap. The App receives the frontend data fron a backend on the internet and make it an offline app using cache manifest. This worked for half a year now perfectly, but now, if the app is trying to update, it downloads everything but at the end, I get the error

03-24 19:42:41.304: E/SQLiteLog(2951): (13) statement aborts at 10: [INSERT INTO CacheResourceData (data, path) VALUES (?, ?)] 
03-24 19:42:41.304: E/SQLiteLog(2951): (1) statement aborts at 2: [ROLLBACK] cannot rollback - no transaction is active

on the LogCat logs. Dose anyone now, what this means, what the problem is and maybe, how I can solve this? The AppCacheMaxSize is already set to 100MB and this is much more then the application really needs.

Paul Spieker
  • 133
  • 2
  • 9

2 Answers2

1

Sounds like there is simply too much data in the database to handle.

The error 10 status code means that A lock for the transaction could not be obtained in a reasonable time. (see https://developer.mozilla.org/en-US/docs/IndexedDB/IDBDatabaseException).

koko
  • 958
  • 12
  • 26
  • Danke, damit habe ich zumindest einen neuen Ansatz wonach ich suchen kann. Hat vielleicht jemand eine Idee wie ich diesen Fehler in PhoneGap vermeiden kann ohne die externen Daten zu minimieren? – Paul Spieker Mar 25 '13 at 18:50
0

I solved the problem by increasing the appCache limit.

Put this code in your [appName].java at the end of your onCreate method.

if(android.os.Build.VERSION.SDK_INT >= 7) {
    //set custom cache size (20 MB), as the default seems to be to small (5 MB)
    //this is deprecated since API 18 but seems still to be needed
    super.appView.getSettings().setAppCacheMaxSize(1024*1024*20);
}

Unfortunately this method is deprecated since version 18. But it is still needed to get my app work with appCache at the moment. Source: http://developer.android.com/reference/android/webkit/WebSettings.html#setAppCacheMaxSize(long)

meaku
  • 897
  • 1
  • 9
  • 14