Comments (3)
Thanks for the sample. The change in behaviour is due to Hibernate which Spring Boot 3.3.x upgrades to 6.5.x. If I run the tests with Spring Boot 3.3.1 and Hibernate downgraded to 6.4.9.Final they all pass.
I'm not sure that a fully understand the purpose of the tests, but they appear to be relying on some side-effects of Hibernate's behavior despite not actually using JPA. Specifically, they seem to be relying up Hibernate calling getConnection()
on the DataSource
. I would guess that some optimisations in Hibernate 6.5.x mean that it no longer gets a connection so eagerly which results in connectionReadOnlyCaptor
not capturing anything.
You can see similar failures with Spring Boot 3.2.7 if you change the tests from @DataJpaTest
to @JdbcTest
. Doing so takes Hibernate out of the picture and means that getConnection()
is never called on the DataSource
. As far as I can tell, you need to rework your tests to avoid relying upon a side-effect of how Hibernate behaves.
from spring-boot.
Just coming here to say the same thing. Adding the following to the build scripts makes the tests pass:
buildscript {
extra.apply {
set("hibernate.version", "6.4.9.Final")
}
}
To cause seems to be a change in org.hibernate.resource.jdbc.internal.AbstractLogicalConnectionImplementor
where the commit()
method now checks isPhysicallyConnected()
which returns false
.
from spring-boot.
Thanks for the explanation!
I think I got the issue and related commit.
Adding a simple entityManager.createQuery("select 1").getResultList();
to all inner transactions fixes nearly all tests, because it forces a connection acquisition (took it from the test from the linked commit) and hence a call for dataSource.getConnection()
.
from spring-boot.
Related Issues (20)
- Some @ControllerEndpoint and @RestControllerEndpoint infrastructure remains undeprecated HOT 1
- Allow ContainerConnectionDetailsFactory to match on one of multiple different connection names
- Spring Authorization Server now defaults multipleIssuersAllowed to false and it cannot be easily re-enabled
- Exceeding 32 @SpringBootTest Configurations Causes Netty RejectedExecutionException with WebFlux HOT 5
- Fix documentation links in the README
- Fix documentation links in the README
- Add support for CNB platform API version 0.14
- Constructor binding of EnumMap fails due to missing key type HOT 2
- DynamicPropertyRegistry Values Not Set After Dev Tools Reload for RestartScope Containers
- Upgrade to Spring RESTDocs 3.0.2
- Upgrade to Spring Framework 6.2.0-M6
- Spring Boot 2 datasource can not run with Dockerfile HOT 4
- ClassNotFoundException in JSP compiler after update from Spring Boot 3.3.1 -> 3.3.2 HOT 8
- Broken documentation links HOT 2
- java.lang.LinkageError: loader 'app' attempted duplicate class definition for jakarta.persistence.TemporalType HOT 1
- Has the loading order of springboot3 beans changed? HOT 1
- Wait until spring-boot.rb file is available when updating Homebrew tap
- Spring Boot profiles not respected when fetching configuration files from Spring Cloud Config after native build HOT 7
- Constructor binding of EnumMap fails due to missing key type
- Constructor binding of EnumMap fails due to missing key type
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-boot.