Guys,
What versions of Hibernate, Hibernate Entity Manager and Spring are you using?
I've grabbed the sample code from Thomas' presentation, but can't seem to get it to do what I want. Keeping the code as it is, I get:
getEntityManager() is null. I can force creation of it by EntityManagerFactory.createEntityManager(), but them I'm faced withCode:java.lang.NullPointerException at com.springdeveloper.service.BeerDistributorServiceJpa.getCustomerList(BeerDistributorServiceJpa.java:27) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ...
I'm using the JpaTransactionManager as supplied in the sample code, but it doesn't seem to create a new tx when required.Code:javax.persistence.TransactionRequiredException: no transaction is in progress at org.hibernate.ejb.AbstractEntityManagerImpl.checkTransactionActive(AbstractEntityManagerImpl.java:130) at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:145) at com.springdeveloper.service.BeerDistributorServiceJpa.saveCustomer(BeerDistributorServiceJpa.java:48)
FYI, Hibernate 3.1rc1, Hibernate EM 3.1beta4, Spring 1.3RC1
Can anyone shed some light on this?
thanks!


Reply With Quote

