android - Mystery error: "Failed to open database phenotype.db, database is locked." Can't find any info online -


i trying test app , wouldn't launch, instead kept getting error:

failed open database '/data/data/com.google.android.gms/databases/phenotype.db'. android.database.sqlite.sqlitedatabaselockedexception: database locked (code 5): , while compiling: pragma journal_mode 

i can't find information error online, , no information on phenotype.db does. not doing related databases @ time when tested this; changes made layout-related.

weirdly enough happened on app testing few weeks ago. different app, being tested on different device, different computer, , exact same error came up. in case switched different device , error went away. device switched having error.

is kind of glitch google? can resolve can test app?

you have forgotten close database, or thread writing database when trying write it. sqlite locks database when writing avoid corruption if entity tries write same database @ same time. android, show error in logcat, , query supplied forgotten.
recommendations:

  • you access database 1 sqlopenhelper
  • you make sure close instances of database helpers once have finished them
  • you make sure end transactions endtransaction() if not set them successful (i.e. if want roll 'em back), in case use transactions

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -