use of com.raizlabs.android.dbflow.structure.database.transaction.DefaultTransactionManager in project DBFlow by Raizlabs.
the class DatabaseDefinition method reset.
/**
* Performs a full deletion of this database. Reopens the {@link FlowSQLiteOpenHelper} as well.
*
* @param context Where the database resides
*/
public void reset(Context context) {
if (!isResetting) {
isResetting = true;
getTransactionManager().stopQueue();
getHelper().closeDB();
for (ModelAdapter modelAdapter : modelAdapters.values()) {
modelAdapter.closeInsertStatement();
modelAdapter.closeCompiledStatement();
}
context.deleteDatabase(getDatabaseFileName());
// recreate queue after interrupting it.
if (databaseConfig == null || databaseConfig.transactionManagerCreator() == null) {
transactionManager = new DefaultTransactionManager(this);
} else {
transactionManager = databaseConfig.transactionManagerCreator().createManager(this);
}
openHelper = null;
isResetting = false;
getHelper().getDatabase();
}
}
Aggregations