i am working with multiple channels . I need to change channel some times. But problem is that, i have to stop pull then set pull url and new channel & then start pull replication for get data using new channel .
Is there any option for create multiple replication object from same syncURL?
I have added channels for pull . But no documents found . I have called pullReplication with changeLintener . But didn’t get old documents . Only got which has changed . How i will get old documents which i didn’t emmit into Map first time ?
Have you pulled with that set of channels before? If you did, then the replication will pull the documents in those channels that have changed since the last time.
In other words, a plain replicator (no channels specified) has a separate state from a replicator with one set of channels, which has a separate state from a replicator with another set of channels.
If you call reset on a Replicator instance, it will clear its state and fetch everything. (But this will be slower.)
remoteDatabase = try cbManager.openDatabaseNamed(remoteDatabaseName.lowercased(), with: options) in background mode gets nil . How i solve it ? This is error output : domain: “SQLite” - code: 14
#define SQLITE_CANTOPEN 14 /* Unable to open the database file */
You’re running into iOS filesystem protection. By default it’s not possible to open files while your app is in the background and the device is locked. You’ll need to change the parent directory’s file protection mode to NSFileProtectionCompleteUntilFirstUserAuthentication (probably before creating the database.) See the iOS developer docs for more details.
******* THREAD-SAFETY VIOLATION: This database is being used on a thread it wasn’t created on! Please see the concurrency guidelines in the Couchbase Lite documentation** . Can you give me any hint ?
Um, you’re calling a database (or an object created by it) on the wrong thread. Just like it says. If you’re using a dispatch queue, you have to set it as the database’s dispatchQueue property.