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

Stracktrace-Error #142

Open
h0jeZvgoxFepBQ2C opened this issue May 24, 2018 · 8 comments
Open

Stracktrace-Error #142

h0jeZvgoxFepBQ2C opened this issue May 24, 2018 · 8 comments

Comments

@h0jeZvgoxFepBQ2C
Copy link

h0jeZvgoxFepBQ2C commented May 24, 2018

Hi,

we are getting quite frequently following error, which is only displayed in verbose log level:

05-24 13:24:35.627 V/SQLiteCursor: Cursor open object=52072473
    java.lang.Throwable: stacktrace
        at android.database.sqlite.SQLiteCursor.<init>(SQLiteCursor.java:117)
        at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:50)
        at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1346)
        at android.database.sqlite.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1285)
        at com.j256.ormlite.android.compat.JellyBeanApiCompatibility.rawQuery(JellyBeanApiCompatibility.java:21)
        at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:193)
        at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:72)
        at com.j256.ormlite.stmt.StatementExecutor.queryForFirst(StatementExecutor.java:106)
        at com.j256.ormlite.dao.BaseDaoImpl.queryForFirst(BaseDaoImpl.java:240)

Do you have any hints? There are no cursor leaks afaik, so I'm really not sure why I see this message so often. This also happens when I start my app completely clean and don't do much sql writing/reading work...?

I don't see any other exceptions happening...

@j256
Copy link
Owner

j256 commented Jun 11, 2018

Is this really the full exception or is there a caused-by information?

@h0jeZvgoxFepBQ2C
Copy link
Author

h0jeZvgoxFepBQ2C commented Jun 11, 2018

This is really unfortunately the full exception, there is no more information showing up. The strange thing is also, that this error is only shown in verbose-logging and not showing up in higher log levels..

It looks like it's not related to multiple processes accessing the database - we get the error in our application in single process-mode and also in multi-process-mode (services seperated to multiple processes)..

I'm also not sure if this is hardware-vendor specific, since I don't get these errors in my android studio emulator :(

@j256
Copy link
Owner

j256 commented Jun 12, 2018

Ouch. Is it possible this is after the application has closed but is not fully down and part of it comes up thinking it is has valid database connections? I'm really not an Android programmer although I play one on TV so I'm not going to be much help. Maybe posting that stack on SO?

@h0jeZvgoxFepBQ2C
Copy link
Author

I've posted this error on SO too: https://stackoverflow.com/questions/50875210/ormlite-stacktrace-error-without-further-log-entries

@j256
Copy link
Owner

j256 commented Oct 14, 2018

Any chance you are trying to do database operations before the database is open somehow?

@h0jeZvgoxFepBQ2C
Copy link
Author

I have another stacktrace now, not sure if it helps:

10-23 16:02:49.093 D/SQLiteDatabase: Open database
    java.lang.Throwable: stacktrace
        at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:815)
        at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:714)
        at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:576)
        at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:269)
        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:223)
        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:163)
        at com.j256.ormlite.android.AndroidConnectionSource.getReadWriteConnection(AndroidConnectionSource.java:68)
        at com.j256.ormlite.android.AndroidConnectionSource.getReadOnlyConnection(AndroidConnectionSource.java:55)
        at com.j256.ormlite.dao.BaseDaoImpl.queryForFirst(BaseDaoImpl.java:238)

@noordawod
Copy link
Collaborator

Would it be possible to have a minimal viable app where you can replicate this behaviour? The stack trace gives away nothing that can help trace this bug.

@h0jeZvgoxFepBQ2C
Copy link
Author

Unfortunately not, since the original application is quite complex and it's impossible for me to put all these things together. Also it's not happening in the android emulator, so its pretty 💩 :(

No, the database should be open already. How can I ensure that the database is open?

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

3 participants