I posted this to the spring forums, sorry for the xpost.
I am new to spring. I am working on an existing project that uses spring 1.2.8 (old, I know), and java 1.5 so annotations should work.
I am trying to use the @Transactional annotation on a concrete class, following the docs at: http://static.springsource.org/spring/docs/1.2.8/reference/transaction.html#d0e6062
So I have something like so:
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="DataSource"/>
</bean>
<bean id="MyDAO"
class="com.company.package.dao.spring.MyDAOImpl">
<property name="dataSource" ref="DataSource" />
</bean>
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"/>
<bean class="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor">
<property name="transactionInterceptor" ref="txInterceptor"/>
</bean>
<bean id="txInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager" ref="transactionManager"/>
<property name="transactionAttributeSource">
<bean class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource"/>
</property>
</bean>
and I annotate my class:
@Transactional(propagation = Propagation.REQUIRED)
public class MyDAOImpl extends JdbcDaoSupport implements MyDAO{
...
}
When I run it I can see in my debug logs that spring is finding all of the classes: Code:
01-07-10 12:10:45 DEBUG [DefaultXmlBeanDefinitionParser] Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator]
01-07-10 12:10:45 DEBUG [DefaultXmlBeanDefinitionParser] Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor]
01-07-10 12:10:45 DEBUG [DefaultXmlBeanDefinitionParser] Neither XML 'id' nor 'name' specified - using generated bean name [org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#329f3d]
but after that there is no mention of annotations or transactions. I don't even know if there are supposed to be. I am verifying in my mysql log that the queries are not being performed transactionally.
Any ideas?