Is there a rollback on mutation errors?

948
3
Jump to solution
04-21-2022 01:37 PM
MaximeDemers
Occasional Contributor III

Hi,

 

I am using the Urban API to create parcels in batch, but sometimes I am facing the 504 timeout error even if I keep the number of features per call under 200.

 

My question is, is there a rollback when an error occur?

I see in the error json that there is a rollbackOnFailure property set to true, but when I take a look in Urban, I see that the parcels were created even when there was a 504.

MaximeDemers_0-1650573188286.png

 

If there is a rollback I could try again the call when it failed, but if there is no rollback it will be difficult to check if those parcels are already created or not.

 

Thank you for the precision!

Maxime Demers

 

 

0 Kudos
1 Solution

Accepted Solutions
AgnieszkaRozniak
Esri Contributor

Hi Maxime, 

Timeout values are not configurable. Currently, we also don't support async requests without a timeout. 

For now, I recommend dividing all parcels into batches of N items and sending each batch as an own job. You could either wait for each job to return or send them in parallel.

Additionally, the more complex the geometry, the more demanding the request to the API. Have you tried to work with smaller batches? Have you encountered the timeout issues in this case?

Please let us know if you think that you encounter any bugs or unexpected behavior from the Urban API. 

Best regards, 

Agnieszka

View solution in original post

3 Replies
AgnieszkaRozniak
Esri Contributor

Hello Maxime, 

Thank you for reaching us to learn more about the ArcGIS Urban API. To answer your question: if the `rollbackOnFailure` property is set to true, rollback on failure is active. In your case, this means the following: either all or none of the parcels in the batch are created

About the 504 timeout error that you are experiencing. There are two possibilities of what happens in that case: 

  • The creation of one or more parcels fails. As a result, since the rollback on failure is active, none of the parcels from the batch are created. A 504 timeout error is returned. 
  • The creation of parcels succeed. However, even though the backend (ArcGIS Online) was able to complete the transaction, it then failed to get the response back in time and timed out. In that case, all the parcels from the batch are created regardless of the 504 error. 

Please let me know if this explanation is clear and consistent with the behavior you are experiencing.

Best regards, 

Agnieszka Rożniak

MaximeDemers
Occasional Contributor III

Hi Agnieszka,

Thank you for your answer.

That make a lot of sense. I understand the roll back is on failure and 504 is not necessary a failure, most of the time it will be a success.

As the timeout is not defined at the client level, but in the API server, I cannot increase the timeout value, right? Is there a possibility to make async requests that wont timeout?

From what I understand, in case of 504, the only way I can know if the parcels were created or not is to make a query to the database and check if those parcels exist?

Thank you again for your time with my questions.

 

Best regards,

Maxime Demers

 

0 Kudos
AgnieszkaRozniak
Esri Contributor

Hi Maxime, 

Timeout values are not configurable. Currently, we also don't support async requests without a timeout. 

For now, I recommend dividing all parcels into batches of N items and sending each batch as an own job. You could either wait for each job to return or send them in parallel.

Additionally, the more complex the geometry, the more demanding the request to the API. Have you tried to work with smaller batches? Have you encountered the timeout issues in this case?

Please let us know if you think that you encounter any bugs or unexpected behavior from the Urban API. 

Best regards, 

Agnieszka