cmisopencmisdotcmis

Get the latest ChangeLog token with OpenCMIS/DotCMIS


I have some code that needs to know the latest ChangeToken, so I wrote:

session.Clear();
var token = session.RepositoryInfo.LatestChangeLogToken;

Unfortunately, it does not always return the latest token.
Example:

  1. Start the session
  2. Run the code above, I get 72
  3. Create a folder on the server
  4. Start CMIS Workbench, read the token, it is 73
  5. Run the code above again while still in the same session, I get 72 <-- Problem

Is there a way to somehow "reset" the session, or clear the cache better?
I would prefer to not create a new session every time.


Solution

  • OpenCMIS has the Session.getLatestChangeLogToken() method for that, which does the same. Clearing the caches or fetching the repository info is not necessary.