<bean id= "Basetransactionproxy" class= " Org.springframework.transaction.interceptor.TransactionProxyFactoryBean "
lazy-init=" true "abstract=" true " >
<property name= "TransactionManager" >
<ref bean= "TransactionManager" />
</ property>
<property name= "transactionattributes" >
<props>
<prop key= "insert*" > propagation_required,-exception</prop>
<prop key= "update*" >propagation_required,-exception</ prop>
<prop key= "delete*" >PROPAGATION_REQUIRED,-Exception</prop>
<prop key= "get*" >PROPAGATION_REQUIRED,readOnly</prop>
<prop key= "find*" >propagation_required,readonly</ prop>
</props>
</property>
</bean>
propagation_required--supports the current transaction and creates a new transaction if there are currently no transactions. This is the most common choice.
propagation_supports--supports the current transaction and executes it in a non transactional manner if there are currently no transactions.
More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/
propagation_mandatory--supports the current transaction and throws an exception if there are currently no transactions.
propagation_requires_new--creates a new transaction and suspends the current transaction if there is currently a transaction.
propagation_not_supported--performs an operation in a non transactional manner and suspends the current transaction if there is a current transaction.
propagation_never--executes in a non transactional manner and throws an exception if there is a current transaction.
propagation_nested--executes within a nested transaction if a transaction is currently present. If there is currently no transaction, a similar operation is performed with Propagation_required. Methods to improve query speed of SQL statements
All current transactions use the "Propagation_required" property value, and the control of transaction permissions is read-only to ensure that the data is not updated at the time of the query.
The "propagation_required" attribute described above would create transactions for all operations, resulting in an update operation in the JPA log query, and thus inefficient.
To change the operation of all queries to a transaction type of "Propagation_never" (without a transaction), query efficiency is immediately elevated,
But at this point worry about a problem: for example, in a savexxx () method, if the method internal use of update, query, and then update the operation process, will not cause the call query, due to the above configuration caused by throwing an exception.
Other than that
-exception indicates that a transaction is rolled back when a exception is thrown. -On behalf of the Rollback + on behalf of the submission
ReadOnly is read only, set operation permissions for read-only, generally used to query the method, optimize the role.