Thursday 28 September 2017

SQLiteLog - file unlinked while open: /data/data/ when update database version

Hi,

This is the common issue which is related when we upgrade db by copuing prebuilt db in apk file and forget to set the version in db file which we copy in the asset folder. Means :

We set the new version in DBHelper but our copying db is having the older version which we forgot. So, whenever we update the version in DBHelper file, open out db new db file in sqlite browser and run below comand in sqlite query editor:

First check which version:
PRAGMA user_version ; 

above line will give you the version having the DB which will be your last version.

Now, we need to increment it by 1 or whatever we set in DBHelper, We need to set that version number here: below is thee command for the same:

PRAGMA user_version = <new_version_number>; 

Thats it. Run your program. you will be good.


No comments:

Post a Comment

Extract error records while inserting into db table using JDBCIO apache beam in java

 I was inserting data into postgres db using apache beam pipeline. it works perfectly with JdbcIO write of apache beam library. But, now, i ...