Reputation: 65
if already a request is processing and a new request occurred at same time into a @async annotated function lets say:
public String importData(ImportRequest requestBody)
{
File file = new File(path.toString() + "/" +
requestBody.getFileName() + ".xlsx");
FileInputStream fis = new FileInputStream(file);
XSSFWorkbook workbook = new XSSFWorkbook(fis);
//Iterate through each rows one by one
Iterator<Row> rowIterator = sheet.iterator();
while (rowIterator.hasNext()) {
saveDataFromFileToDb();
}
}
if a file has 1000 rows and its still processing in background, and suddenly one more request arrives then what happens.
Upvotes: 0
Views: 60