提交 6fcf3a10 编写于 作者: J Juergen Hoeller

SharedEntityManagerCreator detects JPA 2.2's getResultStream method as query-terminating

This commit also changes "hibval5Version" to the more general "hibvalVersion" build variable, and includes dependency updates to Caffeine 2.5.1 and JRuby 9.1.9.

Issue: SPR-13482
上级 346d5d2f
......@@ -40,7 +40,7 @@ configure(allprojects) { project ->
ext.aspectjVersion = "1.9.0.BETA-5"
ext.beanvalVersion = "1.1.0.Final"
ext.cacheApiVersion = "1.0.0"
ext.caffeineVersion = "2.5.0"
ext.caffeineVersion = "2.5.1"
ext.eclipselinkVersion = "2.6.4"
ext.ehcacheVersion = "2.10.4"
ext.ehcachejcacheVersion = "1.0.1"
......@@ -53,7 +53,7 @@ configure(allprojects) { project ->
ext.gsonVersion = "2.8.0"
ext.hamcrestVersion = "1.3"
ext.hibernate5Version = "5.2.10.Final"
ext.hibval5Version = "5.4.1.Final"
ext.hibvalVersion = "5.4.1.Final"
ext.hsqldbVersion = "2.4.0"
ext.httpasyncVersion = "4.1.3"
ext.httpclientVersion = "4.5.3"
......@@ -504,7 +504,7 @@ project("spring-context") {
optional("javax.money:money-api:1.0.1")
optional("org.eclipse.persistence:javax.persistence:${jpaVersion}")
optional("javax.validation:validation-api:${beanvalVersion}")
optional("org.hibernate:hibernate-validator:${hibval5Version}")
optional("org.hibernate:hibernate-validator:${hibvalVersion}")
optional("joda-time:joda-time:${jodaVersion}")
optional("org.aspectj:aspectjweaver:${aspectjVersion}")
optional("org.codehaus.groovy:groovy-all:${groovyVersion}")
......@@ -805,7 +805,7 @@ project("spring-webflux") {
optional("org.jetbrains.kotlin:kotlin-stdlib-jre8:${kotlinVersion}")
testCompile("io.projectreactor.addons:reactor-test")
testCompile("javax.validation:validation-api:${beanvalVersion}")
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
testCompile("org.hibernate:hibernate-validator:${hibvalVersion}")
testCompile("org.apache.tomcat:tomcat-util:${tomcatVersion}")
testCompile("org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}")
testCompile("org.eclipse.jetty:jetty-server:${jettyVersion}")
......@@ -821,7 +821,7 @@ project("spring-webflux") {
testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
testRuntime("org.jruby:jruby:9.1.8.0")
testRuntime("org.jruby:jruby:9.1.9.0")
testRuntime("org.python:jython-standalone:2.5.3")
testRuntime("org.webjars:underscorejs:1.8.3")
testRuntime("org.glassfish:javax.el:3.0.1-b08")
......@@ -918,7 +918,7 @@ project("spring-webmvc") {
exclude group: "javax.servlet", module: "javax.servlet"
}
testCompile("javax.validation:validation-api:${beanvalVersion}")
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
testCompile("org.hibernate:hibernate-validator:${hibvalVersion}")
testCompile("org.apache.httpcomponents:httpclient:${httpclientVersion}") {
exclude group: "commons-logging", module: "commons-logging"
}
......@@ -933,7 +933,7 @@ project("spring-webmvc") {
testCompile("org.jetbrains.kotlin:kotlin-script-runtime:${kotlinVersion}")
testRuntime("org.jetbrains.kotlin:kotlin-script-util:${kotlinVersion}")
testRuntime("org.jetbrains.kotlin:kotlin-compiler:${kotlinVersion}")
testRuntime("org.jruby:jruby:9.1.8.0")
testRuntime("org.jruby:jruby:9.1.9.0")
testRuntime("org.python:jython-standalone:2.5.3")
testRuntime("org.webjars:underscorejs:1.8.3")
testRuntime("org.glassfish:javax.el:3.0.1-b08")
......@@ -1036,7 +1036,7 @@ project("spring-test") {
testCompile("javax.ejb:javax.ejb-api:${ejbApiVersion}")
testCompile("javax.interceptor:javax.interceptor-api:${interceptorApiVersion}")
testCompile("org.hibernate:hibernate-core:${hibernate5Version}")
testCompile("org.hibernate:hibernate-validator:${hibval5Version}")
testCompile("org.hibernate:hibernate-validator:${hibvalVersion}")
// Enable use of the JUnitPlatform Runner
testCompile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}")
testCompile("com.thoughtworks.xstream:xstream:${xstreamVersion}")
......
......@@ -65,9 +65,9 @@ public abstract class SharedEntityManagerCreator {
private static final Class<?>[] NO_ENTITY_MANAGER_INTERFACES = new Class<?>[0];
private static final Set<String> transactionRequiringMethods = new HashSet<>(6);
private static final Set<String> transactionRequiringMethods = new HashSet<>(8);
private static final Set<String> queryTerminationMethods = new HashSet<>(3);
private static final Set<String> queryTerminatingMethods = new HashSet<>(8);
static {
transactionRequiringMethods.add("joinTransaction");
......@@ -77,9 +77,10 @@ public abstract class SharedEntityManagerCreator {
transactionRequiringMethods.add("remove");
transactionRequiringMethods.add("refresh");
queryTerminationMethods.add("getResultList");
queryTerminationMethods.add("getSingleResult");
queryTerminationMethods.add("executeUpdate");
queryTerminatingMethods.add("executeUpdate");
queryTerminatingMethods.add("getSingleResult");
queryTerminatingMethods.add("getResultList");
queryTerminatingMethods.add("getResultStream");
}
......@@ -376,7 +377,7 @@ public abstract class SharedEntityManagerCreator {
throw ex.getTargetException();
}
finally {
if (queryTerminationMethods.contains(method.getName())) {
if (queryTerminatingMethods.contains(method.getName())) {
// Actual execution of the query: close the EntityManager right
// afterwards, since that was the only reason we kept it open.
EntityManagerFactoryUtils.closeEntityManager(this.em);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册