I got an exception:
org.hibernate.HibernateException: getNamedQuery is not valid without active transaction org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:340)
$Proxy10.getNamedQuery(Unknown Source)
Here is my configuration:
...
<context:annotation-driven/>
<beans:bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<beans:property name="sessionFactory" ref="sessionFactory" />
</beans:bean>
<tx:annotation-driven transaction-manager="transactionManager"/>
...
Also, I added context:annotation-driven
since the tr:annotation-driven
is not working, does <tx:annotation-driven/>
use the transactionManager
which obtain its own session from Hibernate?
I used my derived sessionFactory
using Hibernate3 inside the annotated transaction, so how do I configure the Spring to do so?