<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 495,comments - 227,trackbacks - 0

       這個配置文件是我做SSH的時候用的片斷,用Spring來管理事務(wù): 
    <!-- spring代理hibernate事務(wù)的兩種方法 --> 
         
        <!-- 不管采用哪種方法 下面的這個bean都是必須的 --> 
         
        <bean id="transactionManager" 
            class="org.springframework.orm.hibernate3.HibernateTransactionManager"> 
            <property name="sessionFactory"> 
                <ref local="sessionFactory" /> 
            </property> 
        </bean> 
         
        <!-- 1、spring事務(wù)代理模板 --> 
         
        <!-- 需要事務(wù)的Service類要繼承下面的bean,使用方法如下--> 
         
        <!--  
        <bean id="txProxyTemplate" abstract="true" 
                       class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> 
            <property name="transactionManager"> 
                <ref bean="transactionManager"/> 
            </property> 
            <property name="transactionAttributes"> 
                <props> 
                    <prop key="save*">PROPAGATION_REQUIRED</prop> 
                    <prop key="del*">PROPAGATION_REQUIRED</prop> 
                    <prop key="change*">PROPAGATION_REQUIRED</prop> 
                    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> 
                </props> 
            </property> 
        </bean> 
         
        <bean id="StudentDaoHibernate" 
            class="com.lideedu.yame.dao.hibernate.StudentDAOHibernateImpl" 
            singleton="false"> 
            <property name="sessionFactory"> 
                <ref bean="sessionFactory" /> 
            </property> 
            <property name="classService"> 
                <ref bean="ClassService" /> 
            </property> 
        </bean> 
         
        <bean id="StudentServiceTarget" 
            class="com.lideedu.yame.business.IStudentServiceImpl" singleton="false"> 
            <property name="studentDAO"> 
                <ref bean="StudentDaoHibernate" /> 
            </property> 
        </bean> 
         
        <bean id="StudentService" parent="txProxyTemplate"> 
            <property name="target"> 
                <ref bean="StudentServiceTarget"/> 
            </property> 
        </bean> 
         
        -->     
             
        <!-- 2、spring事務(wù)自動代理 --> 
         
        <!-- 需要事務(wù)的方法只要方法名和下面的模式匹配就可以接受Spring的事務(wù)代理 --> 
         
        <bean id="autoProxy" 
            class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator"> 
        </bean> 
        <bean id="transactionAttributeSource" 
          class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource"> 
            <property name="properties"> 
                <props> 
                    <prop key="save*">PROPAGATION_REQUIRED</prop> 
                    <prop key="update*">PROPAGATION_REQUIRED</prop>             
                    <prop key="del*">PROPAGATION_REQUIRED</prop> 
                    <prop key="change*">PROPAGATION_REQUIRED</prop>         
                </props> 
            </property> 
        </bean> 
        <bean id="transactionInterceptor" 
            class="org.springframework.transaction.interceptor.TransactionInterceptor"> 
            <property name="transactionManager"> 
                <ref bean="transactionManager" /> 
            </property> 
            <property name="transactionAttributeSource"> 
                <ref bean="transactionAttributeSource" /> 
            </property> 
        </bean> 
        <bean id="transactionAdvisor" 
            class="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor"> 
            <constructor-arg> 
                <ref bean="transactionInterceptor" /> 
            </constructor-arg> 
    </bean> 

    posted on 2007-12-21 23:33 SIMONE 閱讀(1306) 評論(0)  編輯  收藏

    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 亚洲精品免费视频| 二个人看的www免费视频| 鲁大师在线影院免费观看| 亚洲伊人成无码综合网| 国产亚洲人成在线影院| 波多野结衣中文一区二区免费| 亚洲人成自拍网站在线观看| 在线成人a毛片免费播放| 亚洲精华国产精华精华液| 日本人护士免费xxxx视频| 色欲aⅴ亚洲情无码AV| 国产性生交xxxxx免费| 国产精品亚洲二区在线| 亚洲AV成人潮喷综合网| 国产成人无码精品久久久免费 | 亚洲三级中文字幕| 色窝窝免费一区二区三区| 亚洲色大成网站www久久九 | 中文字幕免费观看| 亚洲激情校园春色| 午夜私人影院免费体验区| 羞羞视频免费网站含羞草| 亚洲一区二区三区香蕉| 久久不见久久见免费视频7| 精品亚洲国产成人| 国产一区二区免费在线| 两个人看的www免费高清| 麻豆亚洲av熟女国产一区二| 毛片免费全部免费观看| 香蕉视频免费在线播放| 亚洲成色在线综合网站| 国产精品久久免费| 美女视频黄a视频全免费网站一区| 久久亚洲中文字幕精品一区四| 日韩精品内射视频免费观看| 亚洲精品又粗又大又爽A片| 亚洲日韩在线观看免费视频| 91香蕉在线观看免费高清| 欧美日韩亚洲精品| 久久久久亚洲AV成人无码网站| 好男人看视频免费2019中文|