Hi, quick question, is it safe to make multiple in...
# room
r
Hi, quick question, is it safe to make multiple insert queries at once for the same room table? I have a code that fetches multiple pages in sequence from backend and I want to insert all those pages in room, but to save time, I don't want the backend calls to wait for the insertion to finish to start the second call
Copy code
repeat(100) {
  val response = api.getPage(it)
  launch {
    dao.insert(response.items)
  }
}
so potentially if the api response time was less than the insertion time, it could have multiple insertions happening at once, is this safe? or should I have some kind of a queue that makes sure to insert one response at a time?