net.zetetic.database.sqlcipher.SQLiteConstraintException thrown if @Upsert is used
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 30/100
Rechercherichtung
Start by comparing the sqlcipher-android integration commit with the working commit linked in the issue, then trace the reported failure through Room's EntityUpsertionAdapter and SQLCipher's SQLiteConnection. Reproduce the clean-install failure and determine why @Upsert triggers the UNIQUE constraint; done means the upsert succeeds without requiring the @Insert replacement.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
I have implemented the sqlcipher-android in this commit:
https://github.com/PrimalHQ/primal-android-app/commit/4bc4482565e6c0941ca859faae21822e8a347d3d
If I run clean install build I'm getting:
net.zetetic.database.sqlcipher.SQLiteConstraintException: UNIQUE constraint failed: ProfileData.ownerId (code 1555)
at net.zetetic.database.sqlcipher.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
at net.zetetic.database.sqlcipher.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:815)
at net.zetetic.database.sqlcipher.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:823)
at net.zetetic.database.sqlcipher.SQLiteStatement.executeInsert(SQLiteStatement.java:113)
at androidx.room.EntityInsertionAdapter.insert(EntityInsertionAdapter.kt:51)
at androidx.room.EntityUpsertionAdapter.upsert(EntityUpsertionAdapter.kt:91)
at net.primal.android.profile.db.ProfileDataDao_Impl.upsertAll(ProfileDataDao_Impl.java:165)
.....
It turns out that @Upsert is the cause of the crash. If we replace it with @Insert(onConflict = OnConflictStrategy.REPLACE) everything works fine. https://github.com/PrimalHQ/primal-android-app/commit/a46232a1f390f9d0418b4f6189d6ed1d1646d5dc
- Vorherrschende Sprache
- Java
- Sterne
- 277
- Forks
- 38
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus sqlcipher/sqlcipher-android
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
Alle Issues in sqlcipher/sqlcipher-android
Ähnliche Issues
-
Bug Java Platform: Java
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
getsentry/sentry-java#6138 · 1 Kommentar ·
-
bug needs triage p2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
GoogleCloudPlatform/DataflowTemplates#4273 · 1 Kommentar ·
-
[Studio][Bug] Bulk-deleting a full page of alert rules steps the page back while more rules remain Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/rocketmq-dashboard#4654 · 1 Kommentar ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100