I have a facility in my POS app that enables subscribers to backup their DB to a web server. This can then be restored or downloaded to another POS device.
The Upload and Download logic works fine, but I get the following error when I try to use the DB after restoring it.
I save the file to TEMP.db, do an SQL.Close, Copy the file to POS.db, Delete TEMP.db and finally Initialise the SQL, but still get the error.
If I restart the POS app, it works fine with the new DB.
I am using B4Xpages, if that makes a difference...
Thanks,
Kev
The Upload and Download logic works fine, but I get the following error when I try to use the DB after restoring it.
error:
pagesuppliers$ResumableSub_lblRefreshSuppliers_Clickresume (java line: 877)
android.database.sqlite.SQLiteReadOnlyDatabaseException: attempt to write a readonly database (code 1032 SQLITE_READONLY_DBMOVED[1032])
at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method)
at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:1164)
at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:756)
at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:66)
at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:2438)
at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:2359)
at anywheresoftware.b4a.sql.SQL.ExecNonQuery(SQL.java:74)
at com.bookingmy.travel.samoaPOS.pagesuppliers$ResumableSub_lblRefreshSuppliers_Click.resume(pagesuppliers.java:877)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8512)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1139)
I save the file to TEMP.db, do an SQL.Close, Copy the file to POS.db, Delete TEMP.db and finally Initialise the SQL, but still get the error.
If I restart the POS app, it works fine with the new DB.
I am using B4Xpages, if that makes a difference...
Thanks,
Kev