SharedEntityManagerCreator
does not handle all exceptions for stored proc output param retrieval
#30160
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
status: superseded
An issue that has been superseded by another
type: bug
A general bug
Affects: Spring Boot 6.0.4
In the
SharedEntityManagerCreator
class, the following code block invokesgetOutputParameterValue
which can throw aHibernateException
.spring-framework/spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java
Lines 424 to 435 in 800b134
The problem is that the catch block only handles
IllegalArgumentException
.This causes a connection leak in the HikariCP pool because the subsequent
EntityManagerFactoryUtils.closeEntityManager(this.entityManager);
line will never be executed, and the entity manager will never be closed.A possible solution is to change the catch block to handle the more general
Exception
orRuntimeException
instead ofIllegalArgumentException
.The text was updated successfully, but these errors were encountered: