What do server generations represent and when are they refreshed?

332
2
12-06-2023 08:04 AM
Labels (1)
JBeasley
New Contributor III

Hello, 

I am trying to get a better understanding of server generations on hosted feature services, which I am using in the extract changes method.

Some background- I am going to have a scheduled task that checks for recent changes, and given the nature of the changes, updates will occur across different services, emails will be triggered, and other integrated systems will be updated. We are not going the webhook route, though I believe my questions stands regardless of the method. I am able to successfully pull the server gens using the REST API and am running the ArcGIS API for Python extract changes method (linked earlier) to return the json of changes.

What do these numbers represent? In the documentation, it indicates they are "a Unix epoch time value in milliseconds", however this doesn't seem right. An example of a recent server gen number I received today is 1902150. The created time for the service is 1696607246000 (October 6). Even if that number was in seconds and is converted to milliseconds, it doesn't add up to an actual date stamp, at least not a valid one related to the service. 

When are these numbers "refreshed"? Is it after ever time the changes are extracted? I need to know this due to it running from a scheduled task. Say the task runs every 12 hours, can I rely on these numbers to represent all the changes within each 12 hour period? Is there a risk some changes will be omitted? 

Any insight is appreciated, thanks! I can include my current code if it would be helpful, however I don't believe it is necessary. I am experiencing no issues so far, I am just looking for clarity into these objects and the extract changes method. 

0 Kudos
2 Replies
KevinHibma
Esri Regular Contributor

What type of Feature Service are you using? If you're using ArcGIS Enterprise with a referenced feature service (your data is coming from an Enterprise Geodatabase): yes, the server generation numbers are time based as you mention. If you're using a hosted feature service (same for both Online and Enterprise), the server generation numbers are incremented through transactions, but have no relationship to actual time values.

To the best of my knowledge, the values for a hosted feature service are only "refreshed" (incremented) any time an edit happens. Assume your feature service had 0 edits over a 12 hour period: the values should not increase. Contrary, if you had hundreds of edits in the same time period, you would see a large jump between numbers.

0 Kudos
JBeasley
New Contributor III

I see, thank you. They are hosted services, so that explains why the numbers do not reflect a time stamp. 

"Contrary, if you had hundreds of edits in the same time period, you would see a large jump between numbers."- Does this mean that using the extract changes API for Python method could not return all the changes that occurred in that 12 hour period? 

 

Thank you!

0 Kudos