0

We are in the process of moving to Azure SQL Server from Oracle DB for our Spring Batch application that runs for few hours with 50 Threads.

I am getting the following error intermittently

Caused by: org.springframework.dao.DataAccessResourceFailureException: Executing stored procedure; SQL [{call itemmaintenance(?, ?, ?, ?)}]; SQL Server returned an incomplete response. The connection has been closed.;

We are using spring batch 2.1.8 and I want to implement the spring retry? How do I achieve this?

One Developer
  • 99
  • 5
  • 43
  • 103
  • Does this answer your question? [How to create custom retry logic for Spring Datasource?](https://stackoverflow.com/questions/53948890/how-to-create-custom-retry-logic-for-spring-datasource) – pringi Feb 25 '22 at 18:19

1 Answers1

0

To retry the spring you need to restart the dependencies to pom.xml files

<**dependency**>  <**groupId**>org.springframework.retry</**groupId**>  <**artifactId**>spring-retry</**artifactId**>  <**version**>1.2.5.RELEASE</**version**>  </**dependency**>

<**dependency**>  <**groupId**>org.springframework</**groupId**>  <**artifactId**>spring-aspects</**artifactId**>  <**version**>5.2.8.RELEASE</**version**>  </**dependency**

below sample you need to add the following to the main class.

@EnableRetry

Here are the references with related topics

DataAccessResourceFailureException (Spring Framework 5.3.16 API)

Guide to Spring Retry | Baeldung

Retry (spring.io)

SaiSakethGuduru
  • 2,218
  • 1
  • 5
  • 15