diff --git a/app/src/main/java/jackall/devrealm/db/PersonRealmHelper.kt b/app/src/main/java/jackall/devrealm/db/PersonRealmHelper.kt index 9027f6d..957256c 100644 --- a/app/src/main/java/jackall/devrealm/db/PersonRealmHelper.kt +++ b/app/src/main/java/jackall/devrealm/db/PersonRealmHelper.kt @@ -9,7 +9,9 @@ class PersonRealmHelper : BaseRealmHelper() { val query by lazy { realm.where(Person::class.java) } override fun insert(realmObject: Person) { - realm.copyToRealm(realmObject) + realm.executeTransaction { + realm.copyToRealm(realmObject) + } } override fun findAll(): RealmResults {