JAVA google spreadsheet batchUpdate API : com.google.api.client.googleapis.json.GoogleJsonResponseException: 409 Conflict

Viewed 137

In my java spring boot application, I am using google spreadsheet API's but sometimes (very rarely) I got the below exception from batchUpdate API.

Below is the code :-

 BatchUpdateSpreadsheetRequest requestBody = new BatchUpdateSpreadsheetRequest();
        requestBody.setRequests(requests);
        Sheets sheetService = googleConfigConstant.getSheetService();
        Sheets.Spreadsheets.BatchUpdate reques = 
 sheetService.spreadsheets().batchUpdate(spreadsheetId, requestBody);

Exception what I am getting :-

 com.google.api.client.googleapis.json.GoogleJsonResponseException: 409 
Conflict
POST https://sheets.googleapis.com/v4/spreadsheets/dummy-spreadsheet-id:batchUpdate? 
quotaUser=testuser
{
 "code" : 409,
 "errors" : [ {
  "domain" : "global",
  "message" : "The operation was aborted.",
  "reason" : "aborted"
 } ],
 "message" : "The operation was aborted.",
 "status" : "ABORTED"
}

After searching a lot I am not able to find the root cause, any help would be appreciated.

0 Answers
Related