diff --git a/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java b/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java index 9df1ac25a65..0cab73b5e26 100644 --- a/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java +++ b/buildSrc/src/main/java/org/springframework/build/CheckstyleConventions.java @@ -50,7 +50,7 @@ public class CheckstyleConventions { project.getPlugins().apply(CheckstylePlugin.class); project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize().set("1g")); CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class); - checkstyle.setToolVersion("13.7.0"); + checkstyle.setToolVersion("13.9.0"); checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle")); String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion(); DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies(); diff --git a/framework-platform/framework-platform.gradle b/framework-platform/framework-platform.gradle index 9b46109e9ca..48d45a0f9f2 100644 --- a/framework-platform/framework-platform.gradle +++ b/framework-platform/framework-platform.gradle @@ -15,8 +15,8 @@ dependencies { api(platform("org.apache.groovy:groovy-bom:5.0.7")) api(platform("org.apache.logging.log4j:log4j-bom:2.26.1")) api(platform("org.assertj:assertj-bom:3.27.7")) - api(platform("org.eclipse.jetty:jetty-bom:12.1.10")) - api(platform("org.eclipse.jetty.ee11:jetty-ee11-bom:12.1.10")) + api(platform("org.eclipse.jetty:jetty-bom:12.1.11")) + api(platform("org.eclipse.jetty.ee11:jetty-ee11-bom:12.1.11")) api(platform("org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.11.0")) api(platform("org.jetbrains.kotlinx:kotlinx-serialization-bom:1.11.0")) api(platform("org.junit:junit-bom:6.1.2")) @@ -96,10 +96,10 @@ dependencies { api("org.apache.httpcomponents.client5:httpclient5:5.6") api("org.apache.httpcomponents.core5:httpcore5-reactive:5.4.2") api("org.apache.poi:poi-ooxml:5.5.1") - api("org.apache.tomcat.embed:tomcat-embed-core:11.0.23") - api("org.apache.tomcat.embed:tomcat-embed-websocket:11.0.23") - api("org.apache.tomcat:tomcat-util:11.0.23") - api("org.apache.tomcat:tomcat-websocket:11.0.23") + api("org.apache.tomcat.embed:tomcat-embed-core:11.0.24") + api("org.apache.tomcat.embed:tomcat-embed-websocket:11.0.24") + api("org.apache.tomcat:tomcat-util:11.0.24") + api("org.apache.tomcat:tomcat-websocket:11.0.24") api("org.aspectj:aspectjrt:1.9.25") api("org.aspectj:aspectjtools:1.9.25") api("org.aspectj:aspectjweaver:1.9.25") @@ -120,8 +120,8 @@ dependencies { api("org.glassfish:jakarta.el:4.0.2") api("org.graalvm.sdk:graal-sdk:22.3.1") api("org.hamcrest:hamcrest:3.0") - api("org.hibernate.orm:hibernate-core:7.4.4.Final") - api("org.hibernate.validator:hibernate-validator:9.1.2.Final") + api("org.hibernate.orm:hibernate-core:7.4.5.Final") + api("org.hibernate.validator:hibernate-validator:9.1.3.Final") api("org.hsqldb:hsqldb:2.7.4") api("org.htmlunit:htmlunit:4.21.0") api("org.javamoney:moneta:1.4.4") diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/EclipseLinkJpaDialect.java b/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/EclipseLinkJpaDialect.java index c3b76fc627a..7f984356c4d 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/EclipseLinkJpaDialect.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/EclipseLinkJpaDialect.java @@ -24,6 +24,7 @@ import java.util.concurrent.locks.ReentrantLock; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceException; import org.eclipse.persistence.sessions.DatabaseLogin; +import org.eclipse.persistence.sessions.DatabaseSession; import org.eclipse.persistence.sessions.UnitOfWork; import org.jspecify.annotations.Nullable; @@ -45,10 +46,6 @@ import org.springframework.transaction.TransactionException; * EclipseLink in shared cache mode. * *
NOTE: This dialect supports custom isolation levels with limitations. - * Consistent isolation level handling is only guaranteed when all Spring - * transaction definitions specify a concrete isolation level and when using the - * default isolation level with non-readOnly and non-lazy transactions; see the - * {@link #setLazyDatabaseTransaction "lazyDatabaseTransaction" javadoc} for details. * Internal locking happens for transaction isolation management in EclipseLink's * DatabaseLogin, at the granularity of the {@code EclipseLinkJpaDialect} instance; * for independent persistence units with different target databases, use distinct @@ -79,13 +76,6 @@ public class EclipseLinkJpaDialect extends DefaultJpaDialect { * even for non-read-only transactions, allowing access to EclipseLink's * shared cache and following EclipseLink's connection mode configuration, * assuming that isolation and visibility at the JDBC level are less important. - *
NOTE: Lazy database transactions are not guaranteed to work reliably - * in combination with custom isolation levels. Use read-only as well as this - * lazy flag with care. If other transactions use custom isolation levels, - * it is not recommended to use read-only and lazy transactions at all. - * Otherwise, you may see non-default isolation levels used during read-only - * or lazy access. If this is not acceptable, don't use read-only and lazy - * next to custom isolation levels in potentially concurrent transactions. * @see org.eclipse.persistence.sessions.UnitOfWork#beginEarlyTransaction() * @see TransactionDefinition#isReadOnly() * @see TransactionDefinition#getIsolationLevel() @@ -186,12 +176,20 @@ public class EclipseLinkJpaDialect extends DefaultJpaDialect { public Connection getConnection() { Connection con = this.connection; if (con == null) { - transactionIsolationLock.lock(); - try { + DatabaseSession dbs = this.entityManager.unwrap(DatabaseSession.class); + if (dbs.isInTransaction()) { + // Existing Connection to be retrieved from this EntityManager. con = this.entityManager.unwrap(Connection.class); } - finally { - transactionIsolationLock.unlock(); + else { + // New Connection to be acquired by this EntityManager. + transactionIsolationLock.lock(); + try { + con = this.entityManager.unwrap(Connection.class); + } + finally { + transactionIsolationLock.unlock(); + } } this.connection = con; }