java.lang.Object | |||
↳ | org.springframework.transaction.support.DefaultTransactionDefinition | ||
↳ | org.springframework.transaction.interceptor.DefaultTransactionAttribute | ||
↳ | org.springframework.transaction.interceptor.RuleBasedTransactionAttribute |
TransactionAttribute implementation that works out whether a given exception should cause transaction rollback by applying a number of rollback rules, both positive and negative. If no rules are relevant to the exception, it behaves like DefaultTransactionAttribute (rolling back on runtime exceptions).
TransactionAttributeEditor
creates objects of this class.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | PREFIX_COMMIT_RULE | Prefix for commit-on-exception rules in description strings | |||||||||
String | PREFIX_ROLLBACK_RULE | Prefix for rollback-on-exception rules in description strings |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.transaction.support.DefaultTransactionDefinition
| |||||||||||
From interface
org.springframework.transaction.TransactionDefinition
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Create a new RuleBasedTransactionAttribute, with default settings.
| |||||||||||
Copy constructor.
| |||||||||||
Create a new DefaultTransactionAttribute with the the given
propagation behavior.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return the list of
RollbackRuleAttribute objects
(never null ). | |||||||||||
Winning rule is the shallowest rule (that is, the closest in the
inheritance hierarchy to the exception).
| |||||||||||
Set the list of
RollbackRuleAttribute objects
(and/or NoRollbackRuleAttribute objects) to apply. | |||||||||||
Return an identifying description for this transaction definition.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.springframework.transaction.interceptor.DefaultTransactionAttribute
| |||||||||||
From class
org.springframework.transaction.support.DefaultTransactionDefinition
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.transaction.TransactionDefinition
| |||||||||||
From interface
org.springframework.transaction.interceptor.TransactionAttribute
|
Prefix for commit-on-exception rules in description strings
Prefix for rollback-on-exception rules in description strings
Create a new RuleBasedTransactionAttribute, with default settings. Can be modified through bean property setters.
Copy constructor. Definition can be modified through bean property setters.
Create a new DefaultTransactionAttribute with the the given propagation behavior. Can be modified through bean property setters.
propagationBehavior | one of the propagation constants in the TransactionDefinition interface |
---|---|
rollbackRules | the list of RollbackRuleAttributes to apply |
Return the list of RollbackRuleAttribute
objects
(never null
).
Winning rule is the shallowest rule (that is, the closest in the inheritance hierarchy to the exception). If no rule applies (-1), return false.
ex | the exception to evaluate |
---|
Set the list of RollbackRuleAttribute
objects
(and/or NoRollbackRuleAttribute
objects) to apply.
Return an identifying description for this transaction definition.
The format matches the one used by
TransactionAttributeEditor
,
to be able to feed toString
results into bean properties of type
TransactionAttribute
.
Has to be overridden in subclasses for correct equals
and hashCode
behavior. Alternatively, equals(Object)
and hashCode()
can be overridden themselves.