I managed to get the version 8 to replicate correctly. I was not following the tutorial exactly and made assumptions (Although without clarification it is still an assumption).
It seems that instantiating the ReplicationSession and the ReplicationProviders at the time of syncing is critical. I changed my code so that at SyncDatabases() these are created and not kept (And I guess garbage collection takes care of them).
public void syncDatabases()
{
// First get the changes of the two replication-partners
Db4oEmbeddedReplicationProvider providerA = new Db4oEmbeddedReplicationProvider(hostContainer);
Db4oEmbeddedReplicationProvider providerB = new Db4oEmbeddedReplicationProvider(clientContainer);
ReplicationSession replication = Replication.begin(providerA, providerB);
ObjectSet<Object> changesOnHost = replication.providerA().objectsChangedSinceLastReplication();
ObjectSet<Object> changesOnClient = replication.providerB().objectsChangedSinceLastReplication();
// then iterate over both change-sets and replicate it
for (Object changedObjectOnClient : changesOnClient)
{
replication.replicate(changedObjectOnClient);
}
for (Object changedObjectOnHost : changesOnHost)
{
replication.replicate(changedObjectOnHost);
}
replication.commit();
replication.replicateDeletions(Object.class);
}
The constructor just runs openDb() to get the objectContainers initialised.