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

Upload on sync fails for LocalChangeResourceReferenceEntity #2495

Closed
LZRS opened this issue Mar 20, 2024 · 2 comments · Fixed by #2497
Closed

Upload on sync fails for LocalChangeResourceReferenceEntity #2495

LZRS opened this issue Mar 20, 2024 · 2 comments · Fixed by #2497
Assignees
Labels
effort:xsmall Extra small effort - 1 day P1 High priority issue

Comments

@LZRS
Copy link
Collaborator

LZRS commented Mar 20, 2024

          Upload on sync fails here with 
(1) row value misused in "SELECT *
        FROM LocalChangeResourceReferenceEntity
        WHERE localChangeId = (?,?,?,?,?,?,?,?,?,?,?)"
        
java.util.concurrent.ExecutionException: android.database.sqlite.SQLiteException: row value misused (code 1 SQLITE_ERROR): , while compiling: SELECT *
        FROM LocalChangeResourceReferenceEntity
        WHERE localChangeId = (?,?,?,?,?,?,?,?,?,?,?)
	at androidx.work.impl.utils.futures.AbstractFuture.getDoneValue(AbstractFuture.java:515)
	at androidx.work.impl.utils.futures.AbstractFuture.get(AbstractFuture.java:474)
	at androidx.work.impl.WorkerWrapper$2.run(WorkerWrapper.java:316)
	at androidx.work.impl.utils.SerialExecutorImpl$Task.run(SerialExecutorImpl.java:96)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
	at java.lang.Thread.run(Thread.java:1012)
Caused by: android.database.sqlite.SQLiteException: row value misused (code 1 SQLITE_ERROR): , while compiling: SELECT *
        FROM LocalChangeResourceReferenceEntity
        WHERE localChangeId = (?,?,?,?,?,?,?,?,?,?,?)
	at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method)
	at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1069)
	at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:673)
	at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:590)
	at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:62)
	at android.database.sqlite.SQLiteQuery.<init>(SQLiteQuery.java:37)
	at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:46)
	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1714)
	at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1689)
	at androidx.sqlite.db.framework.FrameworkSQLiteDatabase.query(FrameworkSQLiteDatabase.kt:156)
	at androidx.room.RoomDatabase.query(RoomDatabase.kt:490)
	at androidx.room.util.DBUtil.query(DBUtil.kt:75)
	at com.google.android.fhir.db.impl.dao.LocalChangeDao_Impl$20.call(LocalChangeDao_Impl.java:927)
	at com.google.android.fhir.db.impl.dao.LocalChangeDao_Impl$20.call(LocalChangeDao_Impl.java:924)
	at androidx.room.CoroutinesRoom$Companion$execute$4$job$1.invokeSuspend(CoroutinesRoom.kt:88)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	... 3 more

Guessing the query should probably use an IN instead of =

Originally posted by @LZRS in #2442 (comment)

@santosh-pingle
Copy link
Collaborator

I faced the same issue where it was throwing the same exception. However, the temporary change below worked for me.

SELECT *
        FROM LocalChangeResourceReferenceEntity
        WHERE localChangeId IN (:localChangeId)

@santosh-pingle
Copy link
Collaborator

@aditya-07

@aditya-07 aditya-07 added P1 High priority issue effort:xsmall Extra small effort - 1 day labels Mar 20, 2024
@aditya-07 aditya-07 self-assigned this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:xsmall Extra small effort - 1 day P1 High priority issue
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

3 participants