Details

    • Last commented by a User:
      true

      Description

      Introduce org.springframework.orm.hibernate4 packaging, and cut a clean implementation against Hibernate 4 APIs and SPIs. This is both desirable after years of Hibernate 3.2+ support as well as necessary given certain removals (such as AnnotationConfiguration) in the 4.x line.

      Eliminate AnnotationSessionFactoryBuilder and AnnotationSessionFactoryBean in the 4.x line in favor of a SessionFactoryBuilder / LocalSessionFactoryBean that work against the unified org.hibernate.cfg.Configuration; consider support for Hibernate 4 Services (http://bit.ly/gnUAUI)

      Eliminate HibernateTemplate and friends (e.g. HibernateCallback in favor of Spring's more modern 'Native Hibernate DAO' approach which has been used to good effect for quite a while.

      org.springframework.orm.hibernate3 will remain, though possibly as a separate module (jar) from .orm.hibernate4 for dependency reasons.

        Activity

        Hide
        John Kroubalkian added a comment -

        By "Native Hibernate DAO" approach, are you indicating a DAO object with injected SessionFactory, and then just using the Hibernate API directly?

        Show
        John Kroubalkian added a comment - By "Native Hibernate DAO" approach, are you indicating a DAO object with injected SessionFactory, and then just using the Hibernate API directly?
        Hide
        Chris Beams added a comment -

        @John, yes - by "Native Hibernate DAO", we simply mean injecting the SessionFactory and working against it directly. This is as opposed to working against Spring's HibernateTemplate.

        Show
        Chris Beams added a comment - @John, yes - by "Native Hibernate DAO", we simply mean injecting the SessionFactory and working against it directly. This is as opposed to working against Spring's HibernateTemplate.
        Hide
        Donnchadh O Donnabhain added a comment -

        With Hibernate 4.0CR6 I get the following exception:

        java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session;
        	at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:328)
        	at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)
        	at org.springframework.test.context.transaction.TransactionalTestExecutionListener$TransactionContext.startTransaction(TransactionalTestExecutionListener.java:513)

        It looks like org.springframework.orm.hibernate4.HibernateTransactionManager was compiled against Hibernate 3.x since SessionFactory.openSession() returns org.hibernate.Session in Hibernate 4.0 (in fact org.hibernate.classic.Session no longer exists).

        Show
        Donnchadh O Donnabhain added a comment - With Hibernate 4.0CR6 I get the following exception: java.lang.NoSuchMethodError: org.hibernate.SessionFactory.openSession()Lorg/hibernate/classic/Session; at org.springframework.orm.hibernate4.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:328) at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371) at org.springframework.test.context.transaction.TransactionalTestExecutionListener$TransactionContext.startTransaction(TransactionalTestExecutionListener.java:513) It looks like org.springframework.orm.hibernate4.HibernateTransactionManager was compiled against Hibernate 3.x since SessionFactory.openSession() returns org.hibernate.Session in Hibernate 4.0 (in fact org.hibernate.classic.Session no longer exists).
        Hide
        Chris Beams added a comment -

        Hi Donnchadh, see https://issues.springsource.org/browse/SPR-8776, which is already resolved.

        Show
        Chris Beams added a comment - Hi Donnchadh, see https://issues.springsource.org/browse/SPR-8776 , which is already resolved.
        Hide
        Donnchadh O Donnabhain added a comment -

        Thanks Chris, I should have spotted that.

        Show
        Donnchadh O Donnabhain added a comment - Thanks Chris, I should have spotted that.

          People

          • Assignee:
            Juergen Hoeller
            Reporter:
            Chris Beams
            Last updater:
            Trevor Marshall
          • Votes:
            8 Vote for this issue
            Watchers:
            10 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              Days since last comment:
              2 years, 21 weeks, 1 day ago