How to change channel of Pull Replication?

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?

No, you need to stop the replication before changing channels.

Has any way to create multiple Replication object from same Database ?

Sure, just call the factory method again.

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.)

Can you please tell me how i reset Replication instance ? Do i set Replication instance null and then create again or else ?

Sorry, I just realized the reset functionality isn’t in the public API. But you shouldn’t need it.

HI, i want to delete document from local db of couchbase lite . How i will do this ? I don’t want to sync this deleted doc with server .

Use the purge method.

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

From sqlite3.h:

#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.

Exception caught in CBLDatabase withReadLock:

******* 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.