Replies: 1 comment
-
This happens when the job is executed in a different thread. Is the taskExecutor of the job launcher asynchronous? This should not happen with the default |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an spring batch application which is recently been migrated to springboot v3 , spring batch v5 and jdk 17 . The application works fine but I am facing an issue related to Hikari pool connection whenever some Testcases are executed . We have a db update operation in afterJob method of JonExecutionListener and the Hikari error is coming when the db operation is executed in afterJob.
Error we are getting :
org.springframework.jdbc.CannotGetJDBCConnectionException:Failed to obtain JDBC connection .,
caused by : HikariDatasource HikariDatasource(HikariPool-3) has been closed.
I can see some warning as well -
Hikari pool -1 Connection oracle.jdbc.driver.T4CConnection@663dd728 markes as broken because of SQLSTATE(08006), ErrorCode (17002)
Testclasses are written as 👍
@ExtendWith(SpringExtension.class)
@SpringBootTest
@activeprofiles("junit")
public class TestClassA
{
@Autowired
private BatchJobRunner batchRunner;
@test
private void testMethod(){
batchRunner.runJob();
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions