     
     public let realmObjCAdapter: RealmAdapter
     public let rlmObjectType: RLMObject.Type
+    public let dataBaseTag: String = DefaultDatabaseTag.realm.rawValue
     
     public init(realmObjCAdapter: RealmAdapter, rlmObjectType: RLMObject.Type) {
         self.realmObjCAdapter = realmObjCAdapter
         self.rlmObjectType = rlmObjectType
     }
     
-    public func mappingBegins() throws {
-        try self.realmObjCAdapter.mappingBegins()
-    }
-    
-    public func mappingEnded() throws {
-        try self.realmObjCAdapter.mappingEnded()
+    public var isInTransaction: Bool {
+        return self.realmObjCAdapter.isInTransaction
+    }
+    
+    public func mappingWillBegin() throws {
+        try self.realmObjCAdapter.mappingWillBegin()
+    }
+    
+    public func mappingDidEnd() throws {
+        try self.realmObjCAdapter.mappingDidEnd()
     }
     
     public func mappingErrored(_ error: Error) {

        self.init(realm: RLMRealm.default())
    }
    
    public func mappingBegins() throws {
        self.realm.beginWriteTransaction()
    }
    
    public func mappingEnded() throws {
        try self.realm.commitWriteTransaction()
        self.cache.removeAll()
    }

                                                     rlmObjectType: OGMapping.MappedObject.self)
        self.primaryKeys = rlmObjectMapping.primaryKeys
        
        self.rlmObjectMapping = { (toMap: inout MappedObject, context: MappingContext) throws -> Void in
            var ogObject = unsafeDowncast(toMap, to: OGMapping.MappedObject.self)
            try rlmObjectMapping.mapping(toMap: &ogObject, context: context)
        }
    }
    
    public final func mapping(toMap: inout MappedObject, context: MappingContext) throws {
        try self.rlmObjectMapping(&toMap, context)
    }
}

