Sd card mount/unmount
Hello, We have been using a device which has linux operating system. We have been keeping sqlite database file in a sd-card. In normal conditions, after mounting/unmouting we use sqlite database without problem. But sometimes, randomly, we can encounter with an unmount problem: "resource or device busy".
As far as I know, sqlite can cause some problems with network-mounted file systems. I wonder if sd-card mounted file system cause also this kind of error?
Can you please help me?
Thank you very much
I forgot to add some code. Problem occurs in this sequence; ... sqlite3_close(db); umount('sd-card'); ... Best regards,
You should check the return value of this call. If the returned value is not
SQLITE_OK, the database isn't actually closed, and you have leaks of some other resources depending on
db (e.g. prepared statements). See https://sqlite.org/c3ref/close.html for more information on that.
If you do get
sqlite3_close, consider using
fuser to find out if there are any open filehandles on that filesystem. (On an embedded device, where you cannot use
fuser because they don't fit in the image, you can iterate over
/proc/*/fd. But this is an embedded Linux question, not an SQLite question.)