I run into strange problem while developing application using Spring (3.0.5), Hibernate (3.6.0) and Wicket (1.4.14). The problem is: i cannot save or modify any object into
a) You are defining both a Hibernate SessionFactory
and a JPA EntitymanagerFactory
. Which is it going to be? Either use Hibernate's Session API or JPA's Entitymanager API with Hibernate as provider, but not both.
b) You have defined a HibernateTransactionManager
, but since you are using EntityManager
in your code, you need a JpaTransactionManager
instead:
Here's a commented version of your applicationContext.xml:
pl.m4ks.comics
And a design note: DAOs shouldn't be transactional. You should use a service layer that manages the transactions. See this question (and many others) for reference.