CommunicationsException: Communications link failure Caused by: org.hibernate.exception.JDBCConnectionException: could not extract ResultSet

时间:2018-02-03 10:54:01

标签: spring jdbc concurrency java-8

When I am running multiple method concurrently then I am facing Communications link failure with JDBCConnectionException.

Bellow code is causing this issue.

Stream<Supplier<List<?>>> tasks = Stream.of(() -> dashboardResultSDHDao.getMarketResult(),
            () -> dashboardResultSDHDao.getBatchResult(), () -> dashboardResultSDHDao.getModalityChatList(),
            () -> dashboardResultSDHDao.getCoadingTimeList(), () -> dashboardResultSDHDao.getCoderPerformersList());

lists = tasks
// Supply all the tasks for execution and collect CompletableFutures
.map(CompletableFuture::supplyAsync).collect(Collectors.toList())
// Join all the CompletableFutures to gather the results
.stream().map(CompletableFuture::join).collect(Collectors.toList());

Please let me know how we can resolve it.

[1;31mERROR[0;39m o.h.e.jdbc.spi.SqlExceptionHelper.logExceptions - Communications link failure

The last packet successfully received from the server was 420,608 milliseconds ago.  The last packet sent successfully to the server was 19,142 milliseconds ago.
03-02-2018 19:32:02.277 [35m[http-nio-8099-exec-9][0;39m
[1;31mERROR[0;39m c.o.oscar.dao.impl.AccuracyDaoImpl.getAccuracyResult - Exception :org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
javax.persistence.PersistenceException: org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
at com.omega.oscar.dao.impl.AccuracyDaoImpl.getAccuracyResult(AccuracyDaoImpl.java:98)
at com.omega.oscar.dao.impl.AccuracyDaoImpl$$FastClassBySpringCGLIB$$9b8ed9bf.invoke(<generated>)
at java.lang.Thread.run(Unknown Source)
Caused by: org.hibernate.exception.JDBCConnectionException: could not extract ResultSet
at org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:115)
at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
... 177 common frames omitted
Caused by: java.net.SocketTimeoutException: Read timed out

0 个答案:

没有答案