CouchBase Lite Continuous Replication Stops

164 views Asked by At

i'm having a really weird problem with the CBL replicator:

Global:

public Replication _Push;
public Replication _Pull;

In the init:

        _DB = Manager.SharedInstance.GetDatabase(_DBName);
        if (_DB == null) throw new Exception("Unable to initialize CB Lite");

        _Push = _DB.CreatePushReplication(_DBServerURL);
        _Pull = _DB.CreatePullReplication(_DBServerURL);

        List<String> Channels = new List<string>();
        Channels.Add("TestChannel");

        _Push.Channels = Channels;
        _Pull.Channels = Channels;

        _Push.Start();
        _Pull.Start();

        _Push.Continuous = true;
        _Pull.Continuous = true;

The problem is that at the beginning the Replicator starts at Active, then it turns idle, but finally it becomes Stopped and IT doesn't return again.

The CouchBase documentation tells me this:

... A continuous replication, on the other hand, will stay active indefinitely, watching for further changes to occur and transferring them. ...

Stopped: A one-shot replication goes into this state after all documents have been transferred or a fatal error occurs. (Continuous replications never stop.)

So it is really weird... I'm testing it from a desktop app....

I also check both LastError objects, but they are null even when the continuous replication is stopped...

1

There are 1 answers

0
kevinrodriguez-io On BEST ANSWER

Problem solved, it seems like you have to set the Replicators to continuous before starting them:

_Push.Continuous = true;
_Pull.Continuous = true;
_Push.Start();
_Pull.Start();