AnzoClient.updateRepository vs. AnzoClient.replicate

10 views
Skip to first unread message

Michael McIntosh

unread,
Mar 3, 2011, 9:07:03 AM3/3/11
to OpenAnzo
Can someone explain the difference between what these two functions do?

Thanks in advance,
Mike

Jordi Albornoz Mulligan

unread,
Mar 3, 2011, 9:34:08 AM3/3/11
to open...@googlegroups.com
Hi Michael,

On 3/3/2011 9:07 AM, Michael McIntosh wrote:
> Can someone explain the difference between what these two functions do?

Sure.

updateRepository does two things:
1. Sends the queued up transactions, with their statement additions and
deletions, to the server to be written.
2. Ensures that all replica graphs open on the client are up-to-date.
Meaning that they have the latest changes from the server.

The 'replicate' method only does the second step. That is, it makes sure
the replica graphs are up-to-date but doesn't send any transactions for
execution to the server.

The 'replicate' method is very, very rarely used because it's typically
not needed. The replica graphs are automatically kept up-to-date as the
server sends notifications of changes to the client. You don't need to
call 'replicate' in normal circumstances. The reason it exists is for
rare situations related to offline uses of the API. Essentially, you can
imagine a system that persists the transaction queues and replicas and
when you next, connect, it may want to just update the replicas without
sending up the changes yet.

--
Jordi Albornoz Mulligan
Founding Engineer - Cambridge Semantics
jo...@cambridgesemantics.com
(617) 401-7321

Reply all
Reply to author
Forward
0 new messages