We have a spring server which uses MySQL, HikariCP and JPA. we have an API called Foo which uses Spring deferred-result mechanism. in the API we have several DB calls, which why we needed to use @Transactional(readonly=true) annotation.
When the server is under load we see a lot of connection timeouts when HikariCP tries to get a connection from the connection bag.
So my question is, if we wait for the duration of deferred-result (let's say 1 minute), and we already got a connection from HikariCP, will that connection be kept outside of the pool for the duration of 1 minute (until the API finish and the transaction committed/rollbacked?)
thank you