 
     // MARK: Private properties
 
+    private let connectionQueueKey = DispatchSpecificKey<Int?>()
     private let databaseWriteQueue: DispatchQueue
     private var connectionModificationLock: OSSpinLock = OS_SPINLOCK_INIT
 

        self.collectionsLocalStorage = [:]
        self.modifiedCollections = [:]

        databaseWriteQueue.setSpecific(key: connectionQueueKey, value: id)

        self.sqlite = try SQLiteAdapter(sqliteDatabaseUrl: database.url)
        try self.createExtensionConnections()

public final class Connection<Collections: CollectionsContainer> {
    // MARK: Public properties

