Java Reference
In-Depth Information
<tx:advice ...>
<tx:method name= " ... "
rollback-for= " "
no-rollback-for= " java.lang.ArithmeticException " />
In classic Spring AOP, the rollback rule can be specified in the transaction attributes of
TransactionInterceptor and TransactionProxyFactoryBean . The minus sign indicates an exception
to cause a transaction to roll back, while the plus sign indicates an exception to cause a transaction to
<property name= " transactionAttributes " >
<prop key= " ... " >
In Spring's transaction management API, the rollback rule can be specified in a
RuleBasedTransactionAttribute object. Because it implements the TransactionDefinition interface,
it can be passed to a transaction manager's getTransaction() method or a transaction template's
RuleBasedTransactionAttribute attr = new RuleBasedTransactionAttribute();
new RollbackRuleAttribute( IOException.class));
new NoRollbackRuleAttribute( SendFailedException.class));
4-10. Setting the Timeout and Read-Only Transaction Attributes
Because a transaction may acquire locks on rows and tables, a long transaction will tie up resources and
have an impact on overall performance. Besides, if a transaction only reads but does not update data,
the database engine could optimize this transaction. You can specify these attributes to increase the
performance of your application.
Search WWH ::

Custom Search