• spring事务模板使用


    1.配置spring事务模板bean

        <!--spring 模板事务-->
        <bean id="transactionProxy" abstract="true"
            class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
            <property name="transactionManager" ref="TransactionManager" />
            <property name="transactionAttributes">
                <props>
                    *****
                </props>
            </property>
        </bean>

    2.事务服务bean的配置

      <bean id="xxxxDAO" class="com.xxxx.xxxxDAOImpl">
        <property name="sessionFactory" ref="sessionFactory" />
      </bean>
      <bean id="xxxxServiceTarget" class="com.xxxx.xxxxServiceImpl" parent="service">
        <property name="xxxxDAO" ref="xxxxDAO" />
      </bean>
      <bean id="xxxxService" parent="transactionProxy">
        <property name="target" ref="xxxxServiceTarget" />
      </bean>

    使用占位符配置bean的方法:

        <bean id="placeholderConfig"
            class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
            <property name="locations">
                <list>
                    <value>
                        ***.properties
                    </value>
                    <value>
                       ***.properties
                    </value>
                </list>
            </property>
        </bean>

  • 相关阅读:
    Shiro SessionContext和SessionKey的设计概念
    Shiro DefaultWebSessionManager的设计概念
    Shiro SessionDAO的设计概念
    Shiro DefaultSessionManager的设计概念
    Shiro 关于校验Session过期、有效性的设计概念
    Shiro AbstractValidatingSessionManager设计概念
    Windows 查看端口及杀掉进程
    Shiro Session及SessionManager的设计概念
    jQuery操作DOM节点
    jQuery动画效果
  • 原文地址:https://www.cnblogs.com/davidwang456/p/2871519.html
Copyright © 2020-2023  润新知