Skip to content
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

Can not create writeable #630

Open
thonguyen252 opened this issue Jul 13, 2023 · 1 comment
Open

Can not create writeable #630

thonguyen252 opened this issue Jul 13, 2023 · 1 comment

Comments

@thonguyen252
Copy link

Can open a writeable database

Couldn't open a writeable database, but a readonly instead

Couldn't open my_db.db for writing (will try read-only):
net.sqlcipher.database.SQLiteDiskIOException: disk I/O error: COMMIT;
at net.sqlcipher.database.SQLiteDatabase.native_execSQL(Native Method)
at net.sqlcipher.database.SQLiteDatabase.execSQL(SQLiteDatabase.java:2439)
at net.sqlcipher.database.SQLiteDatabase.endTransaction(SQLiteDatabase.java:834)
at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:188)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:241)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:228)
at net.sqlcipher.database.SQLiteOpenHelper.getReadableDatabase(SQLiteOpenHelper.java:224)
at org.greenrobot.greendao.database.DatabaseOpenHelper.getEncryptedWritableDb(DatabaseOpenHelper.java:134)

SQLCipher version: 4.5.0

SQLCipher for Android version: 4.5.0

Are you able to reproduce this issue within the SQLCipher for Android test suite? Not tried yet

I get this issue in the first launch - after installing the app, or after clearing data. I have to recall- mDbOpenHelper.getEncryptedWritableDb(dbPassword) for several times before be able to get a writable database. Or just in the next time I open the app, the issue is gone.

@developernotes
Copy link
Member

Hi @thonguyen252,

It appears you are using the greenDAO library, are you able to reproduce this behavior outside of greenDAO? A quick test would be to try creating a connection to the same database using the SQLCipher for Android library directly. Is the database file located in the databases directory of your application, or another writable location?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants