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

Failed to change locale for db #42

Open
hiasel opened this issue Oct 30, 2019 · 0 comments
Open

Failed to change locale for db #42

hiasel opened this issue Oct 30, 2019 · 0 comments

Comments

@hiasel
Copy link

hiasel commented Oct 30, 2019

Today I've received the following crash when the app tried to delete some entities. It's the first time I am receiving this error, I did not change anything in the calling code.

Fatal Exception: android.database.sqlite.SQLiteException
Failed to change locale for db '/data/user/0/com.my.app/databases/simplenosql.db' to 'en_US'.

As far as I understand https://stackoverflow.com/a/19491862/2350644 might fix the issue.
I.e. in SimpleNoSQLDBHelper.java change the constuctor call from this:

public SimpleNoSQLDBHelper(Context context, DataSerializer serializer, DataDeserializer deserializer) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
        this.serializer = serializer;
        this.deserializer = deserializer;
    }

to this:

public SimpleNoSQLDBHelper(Context context, DataSerializer serializer, DataDeserializer deserializer) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION, SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READWRITE);
        this.serializer = serializer;
        this.deserializer = deserializer;
    }

I wasn't yet able to reproduce this error and test if this really works. I will answer to this post (and possibly create a PR) if it solves the error.

Here is the detailed stack trace:

Fatal Exception: android.database.sqlite.SQLiteException
Failed to change locale for db '/data/user/0/com.my.app/databases/simplenosql.db' to 'en_US'.
android.database.sqlite.SQLiteConnection.setLocaleFromConfiguration (SQLiteConnection.java:567)
android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:305)
android.database.sqlite.SQLiteConnection.open (SQLiteConnection.java:215)
android.database.sqlite.SQLiteConnectionPool.openConnectionLocked (SQLiteConnectionPool.java:705)
android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:272)
android.database.sqlite.SQLiteConnectionPool.open (SQLiteConnectionPool.java:239)
android.database.sqlite.SQLiteDatabase.openInner (SQLiteDatabase.java:1292)
android.database.sqlite.SQLiteDatabase.open (SQLiteDatabase.java:1247)
android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:903)
android.database.sqlite.SQLiteDatabase.openDatabase (SQLiteDatabase.java:893)
android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked (SQLiteOpenHelper.java:355)
android.database.sqlite.SQLiteOpenHelper.getWritableDatabase (SQLiteOpenHelper.java:298)
com.colintmiller.simplenosql.db.SimpleNoSQLDBHelper.deleteEntity (SimpleNoSQLDBHelper.java:75)
com.colintmiller.simplenosql.threading.DataDispatcher.delete (DataDispatcher.java:106)
com.colintmiller.simplenosql.threading.DataDispatcher.run (DataDispatcher.java:80)
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

1 participant