Hi!
We are using sensors which emit a signal every 15 minutes. When they emit a signal they are usually divided into 2-3 different packets that are sent, for example one with humidity, one with temperature, and one with signal strength. They arrive at the same time and when I try to update the sensor object in Appfarm I am getting this error around 200 times per 24h.
I have tried using runtime objects and then persisting, database connected objects, and data connectors.
Do you have any suggestions?
Caused by :: Write conflict during plan execution and yielding is disabled. :: Please retry your operation or multi-document transaction.
Hi,
This issue occurs when you attempt to write or modify an object that is in the process of being written.
When you write to a document in the database, it is locked, and the database will reject any other write requests to the same document. Once the operation is complete, the lock will be released, allowing you to perform another write operation.
You can read more about this error in our documentation.
There are several ways to mitigate this, depending on your setup.
One solution is to add an exception handler below the persist operation and retry the persist until it succeeds.
If you are performing a bulk persist and one of the objects triggers a WriteError
, the entire persist will be rejected. In that case, you can try splitting the persist into individual operations and handle any errors that occur.
// Erik
Hi Erik,
Thanks for the reply. Trying the retry strategy now, will let you know if I run into some issues!