Bug P3
Status Update
Comments
em...@google.com <em...@google.com> #2
We don't support cross-process invalidations yet.
pa...@gmail.com <pa...@gmail.com> #3
At least , add a "refresh all observables" function to alpha4 ? i am trying to implement it by myself with your InvalidationTracker class
pa...@gmail.com <pa...@gmail.com> #4
Okey, I made it and created a method to invalidate all observables below;
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
private void refreshAllLiveData() {
AppDataBase YOUR_DATABASE_WHICH_YOU_BUILD = .....
SupportSQLiteDatabase writableDatabase = YOUR_DATABASE_WHICH_YOU_BUILD.getOpenHelper().getWritableDatabase();
//get the database count;
Cursor cursor = writableDatabase.query("SELECT count(*) FROM sqlite_master WHERE type = 'table' AND name != 'android_metadata' AND name != 'room_master_table';");
int tableCount = 0;
while(cursor.moveToNext()) {
tableCount = cursor.getInt(0);
}
for (int i = 0; i < tableCount; i++) {
//update version table with the incremented count because room modification log stores tables with ids instead of names
writableDatabase.execSQL("INSERT OR REPLACE INTO room_table_modification_log VALUES(null, "+(i)+")");
}
YOUR_DATABASE_WHICH_YOU_BUILD.getInvalidationTracker().refreshVersionsAsync();
}
-----
This is a workaroud for refreshing all live datas, I still prefer to use a proper API you implemented.
Thanx
ke...@gmail.com <ke...@gmail.com> #5
Cross process invalidation is now support in Room 2.1.0 with the enableMultiInstanceInvalidation() API.
di...@gmail.com <di...@gmail.com> #6
Hello, is there a solution?
ai...@gmail.com <ai...@gmail.com> #7
Hi.
I have the same issue in my project and I can't reproduce it at all.
My app is 99.9% crash free, so this issue is pretty much the only issue that has yet to be fixed, but that happens very rarely.
So I don’t understand why this is happening and how to get rid of it.
I have the same issue in my project and I can't reproduce it at all.
My app is 99.9% crash free, so this issue is pretty much the only issue that has yet to be fixed, but that happens very rarely.
So I don’t understand why this is happening and how to get rid of it.
Description
at androidx.recyclerview.widget.RecyclerView$Recycler.tryGetViewHolderForPositionByDeadline (RecyclerView.java:6364)
at androidx.recyclerview.widget.GapWorker.prefetchPositionWithDeadline (GapWorker.java:288)
at androidx.recyclerview.widget.GapWorker.flushTaskWithDeadline (GapWorker.java:345)
at androidx.recyclerview.widget.GapWorker.flushTasksWithDeadline (GapWorker.java:361)
at androidx.recyclerview.widget.GapWorker.prefetch (GapWorker.java:368)
at androidx.recyclerview.widget.GapWorker.run (GapWorker.java:399)
at android.os.Handler.handleCallback (Handler.java:938)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:226)
at android.os.Looper.loop (Looper.java:313)
at android.app.ActivityThread.main (ActivityThread.java:8663)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1135)
Build: AI-212.5712.43.2112.8815526, 202207101541,
AI-212.5712.43.2112.8815526, JRE 11.0.12+7-b1504.28-7817840x64 JetBrains s.r.o, OS Windows 10(amd64) v10.0 , screens 2400.0x1350.0
AS: Chipmunk | 2021.2.1 Patch 2; Kotlin plugin: 212-1.7.10-release-333-AS5457.46; Android Gradle Plugin: 7.2.2; Gradle: 7.3.3; Gradle JDK: version 11.0.12; NDK: from local.properties: (not specified), latest from SDK: (not found); LLDB: pinned revision 3.1 not found, latest from SDK: (package not found); CMake: from local.properties: (not specified), latest from SDK: (not found), from PATH: (not found)Source: send_feedback_icon
IMPORTANT: Please read