Nov 9th, 2011, 12:06 PM
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:
Missing from org.springframework.hibernate4.support:
javapda on forum
Nov 9th, 2011, 01:06 PM
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...
Nov 10th, 2011, 11:22 AM
javapda on forum
Nov 14th, 2011, 11:31 PM
How do I use sessionFactory.getCurrentSession() without using OpenSessionInViewFilter. It all works fine with OpenSessionInViewFilter though, is there anything wrong with that?
Nov 15th, 2011, 01:13 AM
By properly configure your transactions...
Nov 15th, 2011, 01:26 AM
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" />
Your advice would be much appreciated.
Nov 15th, 2011, 01:32 AM
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).
Tags for this Thread