I'm indexing MySQL tables with Hibernate Search and it takes some time. After that Exceptions are thrown:
Communications link failure The last packet successfully received from the server was 239 757 milliseconds ago.
The last packet sent successfully to the server was 30 milliseconds ago.
Could not commit Hibernate transaction Communications link failure during commit(). Transaction resolution unknown.
Indexing is done in a method annotated with @Transactional(readOnly = true) .
MySQL server has in my.cnf directive: wait_timeout = 60.
How can I instruct Spring/Hibernate to not close active transaction? I'm using HikariCP as a dataSource.
Thank you.