protected void saveCategoriesInTransaction(CategoryTree tree) {
   SQLiteDatabase database = db.db();
   database.beginTransaction();
   try {
     insertInTransaction(tree);
     database.setTransactionSuccessful();
   } finally {
     database.endTransaction();
   }
 }
 public void insertInTransaction(CategoryTree tree) {
   db.db().delete("category", null, null);
   db.reInsertCategory(Category.splitCategory(context));
   db.reInsertCategory(Category.noCategory(context));
   insertInTransaction(tree.getRoot().children);
 }