Hi I have faced a wall while I was trying to do transaction management using Spring 3.x and Hibernate 4.
I\'ve searched on the Internet but there were ways to do this in Hi
XMLBean factory is deprecated, I'd recommend using annoations and the latest and greatest spring version if you can (the testing features of spring 3.2 are great). It would simplify things a bit for you, the dao/repository could have this
@Resource(name = "sessionFactory")
private SessionFactory sessionFactory;
@Transactional(propagation = Propagation.REQUIRED)
public T save(final T o) {
return (T) sessionFactory.getCurrentSession().save(o);
}
Which itself could then be injected, and yr config add this :