首页 试题广场 > 试题详情
单选题

【C015478】下列Spring声明式事务的配置中错误的是( )。

  • A.<!-- 配置事务管理器 -->
    <bean id="txManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean>
  • B.<!-- 定义事务通知 -->
    <tx:advice id="txAdvice" transaction-manager="txManager">
    <tx:attributes>
    <tx:method name="get*" propagation="REQUIRED" read-only="true"/>
    <tx:method name="do*" propagation="REQUIRED"/>
    <tx:method name="*" propagation="REQUIRED" read-only="true"/>
    </tx:attributes>
    </tx:advice>
  • C.<!-- 配置事务切面 -->
    <tx:config>
    <aop:pointcut id="serviceMethod"
    expression="execution(* cn.jbit.service.*.*(..))"/>
    <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceMethod"/>
    </tx:config>
  • D.进行以上配置需要事先导入tx和aop命名空间
提交并查看答案
下一题 上一题
Ke星伙伴们的回答/ 2个回答
关闭
关闭
QQ
交流群
邀请
好友
App
下载
意见
反馈
返回
顶部