public class

DefaultTransactionAttribute

extends DefaultTransactionDefinition
implements TransactionAttribute
java.lang.Object
   ↳ org.springframework.transaction.support.DefaultTransactionDefinition
     ↳ org.springframework.transaction.interceptor.DefaultTransactionAttribute
Known Direct Subclasses

Class Overview

Transaction attribute that takes the EJB approach to rolling back on runtime, but not checked, exceptions.

Summary

[Expand]
Inherited Constants
From class org.springframework.transaction.support.DefaultTransactionDefinition
From interface org.springframework.transaction.TransactionDefinition
Public Constructors
DefaultTransactionAttribute()
Create a new DefaultTransactionAttribute, with default settings.
DefaultTransactionAttribute(TransactionAttribute other)
Copy constructor.
DefaultTransactionAttribute(int propagationBehavior)
Create a new DefaultTransactionAttribute with the the given propagation behavior.
Public Methods
String getQualifier()
Return a qualifier value associated with this transaction attribute.
boolean rollbackOn(Throwable ex)
The default behavior is as with EJB: rollback on unchecked exception.
void setQualifier(String qualifier)
Associate a qualifier value with this transaction attribute.
Protected Methods
final StringBuilder getAttributeDescription()
Return an identifying description for this transaction attribute.
[Expand]
Inherited Methods
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

Public Constructors

public DefaultTransactionAttribute ()

Create a new DefaultTransactionAttribute, with default settings. Can be modified through bean property setters.

public DefaultTransactionAttribute (TransactionAttribute other)

Copy constructor. Definition can be modified through bean property setters.

public DefaultTransactionAttribute (int propagationBehavior)

Create a new DefaultTransactionAttribute with the the given propagation behavior. Can be modified through bean property setters.

Parameters
propagationBehavior one of the propagation constants in the TransactionDefinition interface

Public Methods

public String getQualifier ()

Return a qualifier value associated with this transaction attribute.

public boolean rollbackOn (Throwable ex)

The default behavior is as with EJB: rollback on unchecked exception. Additionally attempt to rollback on Error.

This is consistent with TransactionTemplate's default behavior.

Parameters
ex the exception to evaluate
Returns
  • whether to perform a rollback or not

public void setQualifier (String qualifier)

Associate a qualifier value with this transaction attribute.

This may be used for choosing a corresponding transaction manager to process this specific transaction.

Protected Methods

protected final StringBuilder getAttributeDescription ()

Return an identifying description for this transaction attribute.

Available to subclasses, for inclusion in their toString() result.