Closed tomorrowboy closed 8 years ago
You don't have code context. This is a sqlite thing, not an ormlite thing. I would guess you've tried opening multiple connections to the db, but that doesn't work well (see here: http://stackoverflow.com/a/3689883). If problems persist, this is a stack overflow question.
Oh, read that a bit more carefully. If you have multiple processes reading your db, you're definitely in a different hell realm, well outside of ormlite's control. You'll need to understand sqlite and how multiple processes interact. Short answer is to use a content provider, which I generally say are bad, except in the case where multiple processes need to talk to a singular database (multiple linux processes).
HI, In my project the following exception has been encountered, I have multi-thread, and different process to access the db. And I'm sure that I only have one helper.
E/SqliteCursor.cpp( 8057): Bailing on database busy retry
E/SQLiteQuery( 8057): exception: database is locked: retrycount exceeded; query: SELECT * FROM
t_wkItem
W/System.err( 8057): java.sql.SQLException: Problems executing Android query: SELECT * FROM
t_wkItem
W/System.err( 8057): at com.j256.ormlite.misc.SqlExceptionUtil.create(SqlExceptionUtil.java:22)
W/System.err( 8057): at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:166)
W/System.err( 8057): at com.j256.ormlite.android.AndroidCompiledStatement.runQuery(AndroidCompiledStatement.java:57)
W/System.err( 8057): at com.j256.ormlite.stmt.SelectIterator.(SelectIterator.java:55)
W/System.err( 8057): at com.j256.ormlite.stmt.StatementExecutor.buildIterator(StatementExecutor.java:232)
W/System.err( 8057): at com.j256.ormlite.stmt.StatementExecutor.query(StatementExecutor.java:181)
W/System.err( 8057): at com.j256.ormlite.dao.BaseDaoImpl.query(BaseDaoImpl.java:263)
W/System.err( 8057): at com.j256.ormlite.stmt.QueryBuilder.query(QueryBuilder.java:319)
W/System.err( 8057): at com.j256.ormlite.stmt.Where.query(Where.java:485)
W/System.err( 8057): at com.tocel.patrol.app.SubmitOffLinePatrolResultService.submitItemResult(SubmitOffLinePatrolResultService.java:297)
W/System.err( 8057): at com.tocel.patrol.app.SubmitOffLinePatrolResultService.access$1(SubmitOffLinePatrolResultService.java:275)
W/System.err( 8057): at com.tocel.patrol.app.SubmitOffLinePatrolResultService$1.run(SubmitOffLinePatrolResultService.java:144)
W/System.err( 8057): at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:442)
W/System.err( 8057): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err( 8057): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err( 8057): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
W/System.err( 8057): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
W/System.err( 8057): at java.lang.Thread.run(Thread.java:856)
W/System.err( 8057): Caused by: android.database.sqlite.SQLiteDatabaseLockedException: database is locked: retrycount exceeded
W/System.err( 8057): at android.database.sqlite.SQLiteQuery.nativeFillWindow(Native Method)
W/System.err( 8057): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:86)
W/System.err( 8057): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:164)
W/System.err( 8057): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
W/System.err( 8057): at android.database.AbstractCursor.moveToPosition(AbstractCursor.java:161)
W/System.err( 8057): at android.database.AbstractCursor.moveToFirst(AbstractCursor.java:201)
W/System.err( 8057): at com.j256.ormlite.android.AndroidCompiledStatement.getCursor(AndroidCompiledStatement.java:163)
W/System.err( 8057): ... 16 more