I'm building a little Android app and I find the ActiveRecord pattern pretty handy. But since ActiveAndroid development is quite dead, I turned to Realm instead.
I'm surprised nothing is said about this pattern, is it safe to write something like this ?
public void delete(){
Realm realm=Realm.getDefaultInstance();
realm.executeTransaction(new Realm.Transaction() {
@Override
public void execute(Realm realm) {
MyClass.this.deleteFromRealm();
}
});
realm.close();
}