Mary uses decorative threads to add color to her studio as well.
Room on main thread.
Room doesn t support database access on the main thread unless you ve called allowmainthreadqueries on the builder because it might lock the ui for a long period of time.
Dao methods can now be marked as suspending to ensure that they are not executed on the main thread.
You ll notice mary s inspiration board where she keeps images and objects she finds interesting.
Read on to see how to use this how it works under.
Room 2 1 adds support for kotlin coroutines.
Fixed a bug where room would fail to find an appropriate type converter for a field in a kotlin entity class.
By default to avoid poor ui performance room doesn t allow you to issue queries on the main thread.
Fixed a bug where room would perform disk i o in the main thread when subscribing and disposing from an rx return type.
Here an app will crash as the operation is performed on a main thread.
Photo by cheryl zibisky photography.
When room queries return livedata the queries are automatically run asynchronously on a background thread.
Room is an android library on top of sqlite which performs compile time checks on sql queries and frees you up from writing db helpers.
Asynchronous queries queries that return instances of livedata or flowable are exempt from this rule because they asynchronously run the query on a background.
Room takes care of mundane tasks that you used to handle with an sqliteopenhelper.