So this is the code I have having as CBLReplictaion pullReplication and pushReplication:
http://pastie.org/private/a35qxzxa8yba8rsuoeznq
if (object == self.pullReplication && [self.pullReplication changesCount] == 0) {NSLog(@"Info : CouchDBProvider Replication Done");}
The point is that the replication is done correctly, but I have observed that it's done quickly untill I get the following warning:
2014-02-10 12:17:39.530 xxxx[9100:501b] -[CBL_FMDatabase executeUpdate:error:withArgumentsInArray:orVAList:]:757 Database busy (/Users/xxxxx/Library/Application Support/xxxxxx/CouchbaseLite/uid_52f206f367842.cblite)
When this happens, the replication is stopped for a time. It can take the replication to resume maybe 1 minute or 2. Can I do something in order to wait less time.
For more information, I am moving moreless 35.000 documents with a total size of 25MB.
- (void) observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context
{
if (object == self.pullReplication && [self.pushReplication status] == kCBLReplicationStopped) {
NSLog(@"CouchDBProvider Replication Done");
}
if (object == self.pushReplication && [self.pushReplication status] == kCBLReplicationStopped ) {
}
}
-(void) completeSyncReplication{
while (([self.pullReplication status] > kCBLReplicationStopped ) && ([self.pushReplication status] > kCBLReplicationStopped )){
}
}
- When I create the replication I don't start the pusher and the puller, but the replication works. (From what I have read the replication must be started)
- Even when I stop asynchronously the replication, it keeps working.
- In the observer I log the completedChangesCount and changesCount of both pusher and puller and I always get a 0 in both properties.