How to clean/delete greenDao database

Nativ picture Nativ · Apr 29, 2013 · Viewed 12.4k times · Source

Currently I'm doing it like this:

DaoMaster.dropAllTables(getDb(), true);
DaoMaster.createAllTables(getDb(), true);

but then, when I'm trying to add entity to the database, I'm getting crash log saying that this table isn't exist

Edit1: I know that it happens because the db is locked and tables wasn't created yet. So I'm reducing this problem to the problem - how to know if the tables are locked in grrenDao/Sqlite?

Answer

demaksee picture demaksee · Sep 10, 2013

How about using something like this for each table?

daoSession.getSometableDao().deleteAll();