簡體   English   中英

Spring事務配置減去Exception(`-Exception`)的含義

[英]Spring transaction configuration minus Exception (`-Exception`) meaning

我在Spring中有此配置。

-Exception-Exception意味着什么(請參見transactionAttributes屬性)?

這些屬性有充分證明的任何正式文檔或教程嗎?
我的意思是在哪里可以找到文檔,該文檔如何在XML Spring配置文件中定義這些道具(而不是作為注釋)?

    <bean id="proxy_processor"
          class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" 
          lazy-init="default" 
          autowire="default">

        <property name="transactionManager" ref="hibernateTransactionManager"/>
        <property name="target" ref="processor"/>
        <property name="transactionAttributes">
            <props>
                <prop key="process*">PROPAGATION_REQUIRED,-Exception,readOnly</prop>
            </props>
        </property>
    </bean>

干得好:

setTransactionAttributes TransactionProxyFactoryBean文檔。 鍵是方法名稱模式(“ process *”匹配以“ process”開頭的所有方法,等等)。

TransactionAttributeEditor javadoc

-Exception在那里意味着什么(請參見transactionAttributes屬性)?

從后一頁:

異常名稱子字符串前的“ +”表示即使拋出此異常,事務也應提交; 他們應該回滾的“-”。

事務傳播類型在此處記錄

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM