Symptom
You're receiving 2 different errors when sending multiple POST requests to the TemporaryTimeInformation API at the same time.
In particular, when more than one such change is performed consecutively, one of the following two errors are returned and the process is not completed:
- { "error" : { "code" : "COE_GENERAL_BAD_REQUEST", "message" : { "lang" : "en-US", "value" : "[COE0018]A similar temporary time information request was made a few seconds ago. Please refresh your page to view all the temporary time information requests." } } }
- { "error" : { "code" : "COE_GENERAL_BAD_REQUEST", "message" : { "lang" : "en-US", "value" : "[COE0018][key=EMPLOYEE_HRIS_GO_OPTIMISTIC_LOCKING_EXCEPTION, values=[-1, 1, TimeManagementTask]] Messages:[key=EMPLOYEE_HRIS_GO_OPTIMISTIC_LOCKING_EXCEPTION, values=[-1, 1, TimeManagementTask]]" } } }
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
- SAP SuccessFactors HXM Suite
- Employee Central
- OData API
Reproducing the Issue
- Enable API Payloads
- Trigger below API Upsert multiple times at a time:
{"__metadata": {"uri": "TemporaryTimeInformation('*****')"},"userIdNav": {"__metadata": {"uri": "User('*****')"}},"externalCode": "****","workSchedule": "***","startDate": "/Date(*****)/","endDate": "/Date(*****)/"} - Receive the error:
{ "error" : { "code" : "COE_GENERAL_BAD_REQUEST", "message" : { "lang" : "en-US", "value" : "[COE0018]A similar temporary time information request was made a few seconds ago. Please refresh your page to view all the temporary time information requests." } } }
{ "error" : { "code" : "COE_GENERAL_BAD_REQUEST", "message" : { "lang" : "en-US", "value" : "[COE0018][key=EMPLOYEE_HRIS_GO_OPTIMISTIC_LOCKING_EXCEPTION, values=[-1, 1, TimeManagementTask]] Messages:[key=EMPLOYEE_HRIS_GO_OPTIMISTIC_LOCKING_EXCEPTION, values=[-1, 1, TimeManagementTask]]" } } }
Cause
This error is thrown by our system. API error is the validation done to prevent the processing of duplicate TemporaryTimeInformation(TTI) requests. Currently our validation process checks if a similar TemporaryTimeInformation request was already triggered a few seconds ago. There is a memory store which holds the TTI API request for ~3 seconds. If a duplicate request is found, the system triggers the response error message to prevent duplicate processing.
Resolution
You can send TTI (TemporaryTimeInformation) API requests concurrently, but you must ensure that duplicate requests are not sent to the API. Furthermore, you should avoid overlapping time periods for the same user.
So, a solution would be that, introduce a 3-second delay before retrying a failed TemporaryTimeInformation request. This 3-second delay will clear the previous TemporaryTimeInformation request from the memory store, effectively avoiding the duplication issue.
See Also
Keywords
TemporaryTimeInformation API, UPSERT, multiple upsert, concurrent, consecutively, ODATA API, ODATA, COE0018, COE_GENERAL_BAD_REQUEST, UPSERT, SF, temporary time information requests, EMPLOYEE_HRIS_GO_OPTIMISTIC_LOCKING_EXCEPTION, TimeManagementTask , KBA , LOD-SF-INT-ODATA , OData API Framework , Problem