Search code examples
androidsqliteandroid-sqlitein-memory-database

multiple In-memory DB connections?


Will there be any issue if we wont close in memory db connections and invoke as many getReadableDatabase() and getWritableDatabase(). How to effectively manage db connections with in memory.


Solution

  • The get****ableDatabase() documentation says:

    Once opened successfully, the database is cached, so you can call this method every time you need to [access] the database.

    So there will not be any issue; these functions are designed to be invoked many times.

    There is no difference between in-memory and on-disk databases in this regard.