且@transaction一般用在service层
<!-- 事物管理--> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!--开启注解事物--> <tx:annotation-driven transaction-manager="transactionManager"/>
rgaewgerg gwegewrgweg