-
-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS DatabaseException(Error Domain=FMDatabase Code10 "disk i/o error" #71
Comments
Thansk for your report. I'll try to reproduce it first, then maybe try blindly SQLITE_OPEN_FILEPROTECTION_NONE if I cannot reproduce easily (and I'm not an iOS expert so that is always where I'm not sure what I'm doing...). Some information that might help me:
|
|
I could not manage to reproduce the issue (on iPod 5 32 bits and iPod 6 64 bits) with the app I have (launching the app / writing some data / quitting the app / locking twice / restart the app) so hard to find a fix. The issue is definitely happening in other solution (cordova) so I guess it is there. Could you try in your startup iOS code (maybe in AppDelegate.m as a quick test) setting the file protection to none on your existing database (and if it fails as well as the containing folder, and then maybe the wal file too???) to see if that solves your issue? If yes, then we could consider adding file protection none option when opening the database (although i do want to avoid platform specific API as much as possible and don't want to make protection none the default):
|
Thanks for the feedback. I will try this and report back. |
I have investigated further and found a very interesting effect If we do not use routes... home: new MyHomePage(title: 'My App'), Then in the console log from the list of the app we see flutter: Builder Called Fine! Builder is only called twice and critically Query is only called once. NOW.... If we use routes. // home: new MyHomePage(title: 'My App'), Then.. Builder and query are called multiple times (which could be expensive) and the i/o errors occur... flutter: Builder Called Summary
Nicolas |
Ah it seems you have extra steps before opening the database (copying?)...You should make your whole copy/open database in a critical section (using synchronized for example) |
Thanks for your feedback, I am using the async example code to do the database copy from the flutter asset to the app doc folder. Just puzzled that named routes seem to cause multiple calls to the builder.... |
Still puzzled that named routes seem to cause multiple calls to the builder.... |
Ok. Most recent versions of sqflite open a single instance of a database for a given path, maybe this has helped. |
@nicolasjon same error. Are you solved it? |
Hi,
Just moved to a new MacBook, so "everything" was reinstalled. Issue has not
reoccurred.
For me, safe to close.
Thanks
Nicolas
…On Mon, 1 Apr 2019 at 17:53, 炸鸡叔 ***@***.***> wrote:
@nicolasjon <https://github.com/nicolasjon> same error. Are you solved it?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#71 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGPEpU62lm5A6fid3WF-oywqDNqwi-dqks5vcjlvgaJpZM4U30Uq>
.
|
Hi,
First thanks for your great work on this essential library! I have everything working fine on Android.
For iOS, the app loads from Android Studio and runs OK, once the app has been closed and device has been locked/unlocked a couple of times restarting the app no data is displayed and this error is displayed -
iOS DatabaseException(Error Domain=FMDatabase Code10 "disk i/o error"
If the app is then loaded for Android Studio the following console error is shown
DB Error: 10 "disk I/O error"
DB Query: SELECT *, ((51.811834 - Latitude ) * (51.811834 - Latitude ) + (-0.219816 - Longitude) * (-0.219816 - Longitude) * 0.38222820246023875) AS DISTANCE FROM sota where DISTANCE < 7 order by Distance Limit 200
DB Path: /var/mobile/Containers/Data/Application/19B13FD4-267B-47B6-B13B-FC427E34F056/Documents/asset_sota.db
Further observations
Thanks!
Nicolas
The text was updated successfully, but these errors were encountered: