Announcement Announcement Module
Collapse
No announcement yet.
Missing Hibernate Classes/Interfaces in spring-orm-3.1.0.RC1 Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Missing Hibernate Classes/Interfaces in spring-orm-3.1.0.RC1

    As mentioned in an earlier post, we are attempting to convert to spring 3.1.0.RC1 and Hibernate 4 (4.0.0.CR5).

    It seems that several classes/interfaces are no longer available, deprecated, or missing. (It is unclear which, as the documentation does not seem to give status of the hibernate support implementation.

    Q: Can someone provide clarification on the hibernate support in 3.1.0.RC1?

    Q: Are these missing classes coming soon? Or are they replaced with something else?

    In the meantime, is there a recommended path to migrate hibernate support?

    Missing from org.springframework.hibernate4:
    HibernateCallback
    HibernateOperations

    Missing from org.springframework.hibernate4.support:
    HibernateTemplate
    HibernateAccessor
    <others>

    Thanks :-)

  • #2
    HibernateTemplate isn't recommended for use anymore (about since the release of hibernate 3.0.1) there is no more added value so that isn't going to be in there anymore for hibernate 4. Simply use the plain SessionFactory and use the getCurrentSession method to obtain the current transactional session (don't use openSession!!!!) and you are good to go...

    Comment


    • #3
      got it. thanks

      Comment


      • #4
        How do I use sessionFactory.getCurrentSession() without using OpenSessionInViewFilter. It all works fine with OpenSessionInViewFilter though, is there anything wrong with that?

        Comment


        • #5
          By properly configure your transactions...

          Comment


          • #6
            Tnx Marten, Can you advice me a good tutorial or any other material to covering how to configure my DAOs in a recommended way.
            I'm trying to transfer to Hibernate 4.x and Spring 3.1.0. I have rewritten my abstractDao, which has no connection to a HibernateTemplate, but now I just want to find out how to get rid of my OpenSessionInViewFilter.

            I don't have an experience with transactions besides declaring it like the following:


            <bean id="transactionManager" class="org.springframework.orm.hibernate4.Hibernat eTransactionManager">
            <property name="sessionFactory" ref="sessionFactory" />
            </bean>


            Your advice would be much appreciated.

            Comment


            • #7
              That isn't configuring transactions... that is only part of it.. I suggest a read of the transaction chapter in the reference guide. Also the transactional layer of your application should be the service layer (as in general that is the unit-of-work you want to be transactional not a each of the x dao calls you make in that method (you want everything to be in a single transaction).

              Comment

              Working...
              X