Opening a database on Android corrupts it for desktop

Page 1 of 1
8 posts
Opening a database on Android corrupts it for desktop

egdd
New MMEX User

Posts: 7
Joined: Thu Oct 15, 2015 4:46 pm
I am new to this software but I would really like to use it. However, I need both versions (desktop version and Android version) working at the same time.
However, when copying and opening the database between platforms, at some point the desktop application cannot open the database any more.

Steps to reproduce:

1) On the desktop, create a new database and save it as a "mmb".
2) Copy the database to the mobile phone and open the Android application.
3) Open the database (that was created on the desktop) on the Android phone.
4) Strange thing: A lot of notifications of (failing) SQL-insert-statements are shown - is that an expected behaviour?
5) The file should now have been modified by the Android app.
6) Copy the database to the desktop again and open it with the desktop version.
7) Desktop application crashes.


Desktop (Windows 7): 1.2.2
Android (Android 4.4.2): 2.22.1
Re: Opening a database on Android corrupts it for desktop
User avatar
MisterY
Super MMEX User

Posts: 142
Joined: Sat Jan 24, 2015 2:11 pm
Thanks for reporting this. It would be helpful if we got to the bottom of this corruption issue.

If you get messages on Android about failure in creating various tables, it means that it can not properly read the database. SQLite on Android (not the MMEX app) is having issues reading this file.
To confirm, please try to open the database file using something like aSQLiteManager or any other tool that can read SQLite databases on Android.
I have seen only one case so far and the database was opened but showed no tables at all.

This leads the SQLite engine to report that the database is new and that it requires upgrade to the most recent version, and MMEX then issues commands for generation of the database schema. This fails for whatever reason - it would be interesting to see the actual error message.

If you can reproduce this reliably, it would be really helpful to identify the cause.

Also, if you have another mobile device available with a newer Android version, please try there, too. The newer versions of SQLite libraries, distributed with Android, might read the file correctly.
Re: Opening a database on Android corrupts it for desktop
User avatar
MisterY
Super MMEX User

Posts: 142
Joined: Sat Jan 24, 2015 2:11 pm
Also, please see https://github.com/moneymanagerex/andro ... issues/517
where I'm documenting anything related to this issue.
Re: Opening a database on Android corrupts it for desktop

egdd
New MMEX User

Posts: 7
Joined: Thu Oct 15, 2015 4:46 pm
Thanks for your reply. And yes, I can reproduce this as I said.

To assist further, I am lucky to have a second device a tablet at hand with the configuration:

Android (Android 5.1.1): 2.22.1


When I follow my described steps 1 to 7 it works on this configuration! But note that the insert commands described in point 4 still occur when I open the database.

To shed light on the whole thing I attached the three databases

  • testdb.mmb (after creation of the database on the desktop)
  • testdbPhone.mmb (after creation of the database on the desktop and opening it on the phone)
  • testdbTablet.mmb (after creation of the database on the desktop and opening it on the tablet)
The "testdbPhone.mmb" is the one that cannot be opened in the desktop version anymore.
Attachments
testdbTablet.mmb
(80 KiB) Downloaded 122 times
testdbPhone.mmb
(80 KiB) Downloaded 124 times
testdb.mmb
(69 KiB) Downloaded 107 times
Re: Opening a database on Android corrupts it for desktop
User avatar
MisterY
Super MMEX User

Posts: 142
Joined: Sat Jan 24, 2015 2:11 pm
Thank you for providing the data for analysis. This allows for some detailed comparison.

I can see that Android adds a metadata table but also runs the schema all over again, as if it is creating the database from scratch. This is weird but is not the culprit in this case.
During this process, the system on the phone does not provide the currency information, resulting in the base currency being set to -1.
This causes a problem for the desktop version as it seems it is trying to find a currency with this id.

I believe this is related to the crash reports I've received from some users whose system did not provide a valid currency, so the mobile app was crashing also. This particular issue should have been mitigated in the latest version (3.0.2) so that a defined currency is always set.
Please let me know if this is still occuring with the newer app versions.

I'm attaching the SQL versions of the databases for easy comparison with appropriate tools.
Attachments
tablet.sql.txt
(24.28 KiB) Downloaded 126 times
phone.sql.txt
(24.28 KiB) Downloaded 137 times
original.sql.txt
(23.53 KiB) Downloaded 132 times
Re: Opening a database on Android corrupts it for desktop
User avatar
MisterY
Super MMEX User

Posts: 142
Joined: Sat Jan 24, 2015 2:11 pm
Re: Opening a database on Android corrupts it for desktop

egdd
New MMEX User

Posts: 7
Joined: Thu Oct 15, 2015 4:46 pm
Thank you very much for your help, it works fine now!
Re: Opening a database on Android corrupts it for desktop

lindseynicole010
New MMEX User

Posts: 1
Joined: Wed Feb 08, 2017 6:11 am
thanks for that.
Page 1 of 1
Who is online

Users browsing this forum: No registered users and 2 guests

cron