         realm.beginWrite()
         closure(rollback)
         // In case we rolled back
-        guard realm.isInWriteTransaction else { return self }
         commit(errorHandler: onWriteError)
         return self
     }
 
+    private func begin() {
+        guard !realm.isInWriteTransaction else { return }
+        realm.beginWrite()
+    }
+
     private func commit(errorHandler: OnWriteErrorListener) {
+        guard realm.isInWriteTransaction else { return }
         do {
             try realm.commitWrite()
         } catch {

    }

    private func rollback() {
        realm.cancelWrite()
        metadata = [:]
    }


    public var transaction: TorchTransactionHelper {
        return TorchTransactionHelper(
            begin: begin,
            commit: { self.commit(errorHandler: self.defaultOnWriteError) },
            commitWithErrorHandler: commit(errorHandler:),
            rollback: rollback)
