Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Could this also help with the problem where a non-nullable type can be null because nullability is not inferred in the generated Java code? E.g., having a query returning a LiveData<Pojo> but the table of Pojo's is empty so the LiveData will trigger an update with a null value that shouldn't be null (or maybe that is a plain bug).
Description
(manually copied from internal b/162303675 )
It seems room/runtime/src/main/java/androidx/room/RoomDatabase.java is using ConcurrentHashMap which has an issue on Android’s Lollipop release that can lead to lost updates under thread contention. This is further complicated by the fact that we face issues with drops to other repos that forbid its use.
We recommend moving away from it. A possible solution is to use a synchronized map (https://docs.oracle.com/javase/7/docs/api/java/util/Collections.html#synchronizedMap%28java.util.Map%29 ).