From b82d5ae8da7a62a5b2187b6595ffe2111d2bd212 Mon Sep 17 00:00:00 2001 From: Chris Beams Date: Sun, 9 Oct 2011 07:55:21 +0000 Subject: [PATCH] Revert "Implement SessionFactoryImplementor in SF proxies" This reverts commit 08ccd19c76a71be3edf98f1a7f62cdd73ae98c9b. Issue: SPR-8469 --- ...ibernateSessionFactoryConfigurationTests.java | 4 +--- .../hibernate3/SessionFactoryBuilderSupport.java | 16 ++++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/org.springframework.integration-tests/src/test/java/org/springframework/orm/hibernate3/HibernateSessionFactoryConfigurationTests.java b/org.springframework.integration-tests/src/test/java/org/springframework/orm/hibernate3/HibernateSessionFactoryConfigurationTests.java index 3f9df777adf..66344b54bee 100644 --- a/org.springframework.integration-tests/src/test/java/org/springframework/orm/hibernate3/HibernateSessionFactoryConfigurationTests.java +++ b/org.springframework.integration-tests/src/test/java/org/springframework/orm/hibernate3/HibernateSessionFactoryConfigurationTests.java @@ -33,7 +33,6 @@ import org.hibernate.SessionFactory; import org.hibernate.Transaction; import org.hibernate.cfg.AnnotationConfiguration; import org.hibernate.classic.Session; -import org.hibernate.engine.SessionFactoryImplementor; import org.junit.Ignore; import org.junit.Test; import org.springframework.beans.factory.BeanCreationException; @@ -132,11 +131,10 @@ public class HibernateSessionFactoryConfigurationTests { } @Test - public void builtSessionFactoryIsProxyImplementingDisposableBeanAndSessionFactoryImplementor() { + public void builtSessionFactoryIsDisposableBeanProxy() { AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(AnnotationSessionFactoryConfig.class); SessionFactory sessionFactory = ctx.getBean(SessionFactory.class); assertThat(sessionFactory, instanceOf(DisposableBean.class)); - assertThat(sessionFactory, instanceOf(SessionFactoryImplementor.class)); assertThat(sessionFactory.toString(), startsWith("DisposableBean proxy for SessionFactory")); ctx.close(); assertTrue("SessionFactory was not closed as expected", sessionFactory.isClosed()); diff --git a/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/SessionFactoryBuilderSupport.java b/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/SessionFactoryBuilderSupport.java index 140f9bd8cee..cdf1b160b33 100644 --- a/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/SessionFactoryBuilderSupport.java +++ b/org.springframework.orm/src/main/java/org/springframework/orm/hibernate3/SessionFactoryBuilderSupport.java @@ -232,9 +232,8 @@ public abstract class SessionFactoryBuilderSupportSubclasses may override this to implement transaction awareness through * a {@code SessionFactory} proxy for example, or even to avoid creation of the * {@code DisposableBean} proxy altogether. - * @param rawSf the raw {@code SessionFactory} as built by {@link #doBuildSessionFactory()} - * @return a proxied {@code SessionFactory} if wrapping was necessary, otherwise the - * original given 'raw' {@code SessionFactory} object. + * @param rawSf the raw {@code SessionFactory} as built by {@link #buildSessionFactory()} + * @return the {@code SessionFactory} reference to expose * @see #buildSessionFactory() */ protected SessionFactory wrapSessionFactoryIfNecessary(final SessionFactory rawSf) { @@ -565,7 +562,6 @@ public abstract class SessionFactoryBuilderSupport[] { SessionFactory.class, - SessionFactoryImplementor.class, DisposableBean.class }, new InvocationHandler() {