Hi Team,
We have a requirement in our application where we need to insert 2500 rows to MongoDB .
// Sample code to show how we are inserting
For(int i = 0 i< BATCH_SIZE ; i++) {
mongoRepo.saveAll( Collection<> )
}
Here BATCH_SIZE is configurable. In our case it is 100.
When the code is running it is taking more than 15 min and it is partially saving the data (i.e ~ 1600 records out of 2500 ).
After saving 1600 records it is throwing transactionLifeTimeExceededSeconds (error code : 290 ) currently this param is configured for 60 seconds.
Q1) :
Do we need to change the batch size ?
Q2) :
Can we parallelize it ? ( multithreading?)