|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.springframework.transaction.support.DefaultTransactionDefinition
Default implementation of the TransactionDefinition interface, offering bean-style configuration and sensible default values (PROPAGATION_REQUIRED, ISOLATION_DEFAULT, TIMEOUT_DEFAULT, readOnly=false).
Base class for both TransactionTemplate and DefaultTransactionAttribute.
TransactionTemplate,
DefaultTransactionAttribute| Field Summary | |
static java.lang.String |
READ_ONLY_MARKER
Marker for read-only transactions in description strings |
static java.lang.String |
TIMEOUT_PREFIX
Prefix for transaction timeout values in description strings |
| Fields inherited from interface org.springframework.transaction.TransactionDefinition |
ISOLATION_CONSTANT_PREFIX, ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_CONSTANT_PREFIX, PROPAGATION_MANDATORY, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT |
| Constructor Summary | |
DefaultTransactionDefinition()
|
|
DefaultTransactionDefinition(int propagationBehavior)
|
|
| Method Summary | |
boolean |
equals(java.lang.Object other)
This implementation of equals compares the toString results. |
protected java.lang.StringBuffer |
getDefinitionDescription()
Return an identifying description of this transaction definition. |
int |
getIsolationLevel()
Return the isolation level. |
int |
getPropagationBehavior()
Return the propagation behavior. |
int |
getTimeout()
Return the transaction timeout. |
int |
hashCode()
This implementation of hashCode returns toString's hash code. |
boolean |
isReadOnly()
Return whether to optimize as read-only transaction. |
void |
setIsolationLevel(int isolationLevel)
|
void |
setIsolationLevelName(java.lang.String constantName)
Set the isolation level by the name of the corresponding constant in TransactionDefinition, e.g. |
void |
setPropagationBehavior(int propagationBehavior)
|
void |
setPropagationBehaviorName(java.lang.String constantName)
Set the propagation behavior by the name of the corresponding constant in TransactionDefinition, e.g. |
void |
setReadOnly(boolean readOnly)
|
void |
setTimeout(int timeout)
|
java.lang.String |
toString()
Return an identifying description of this transaction definition. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final java.lang.String TIMEOUT_PREFIX
public static final java.lang.String READ_ONLY_MARKER
| Constructor Detail |
public DefaultTransactionDefinition()
public DefaultTransactionDefinition(int propagationBehavior)
| Method Detail |
public final void setPropagationBehaviorName(java.lang.String constantName)
throws java.lang.IllegalArgumentException
constantName - name of the constant
java.lang.IllegalArgumentException - if an invalid constant was specifiedTransactionDefinition.PROPAGATION_REQUIREDpublic final void setPropagationBehavior(int propagationBehavior)
public final int getPropagationBehavior()
TransactionDefinition
getPropagationBehavior in interface TransactionDefinitionTransactionDefinition.PROPAGATION_REQUIRED
public final void setIsolationLevelName(java.lang.String constantName)
throws java.lang.IllegalArgumentException
constantName - name of the constant
java.lang.IllegalArgumentException - if an invalid constant was specifiedTransactionDefinition.ISOLATION_DEFAULTpublic final void setIsolationLevel(int isolationLevel)
public final int getIsolationLevel()
TransactionDefinitionOnly makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.
Note that a transaction manager that does not support custom isolation levels will throw an exception when given any other level than ISOLATION_DEFAULT.
getIsolationLevel in interface TransactionDefinitionTransactionDefinition.ISOLATION_DEFAULTpublic final void setTimeout(int timeout)
public final int getTimeout()
TransactionDefinitionOnly makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.
Note that a transaction manager that does not support timeouts will throw an exception when given any other timeout than TIMEOUT_DEFAULT.
getTimeout in interface TransactionDefinitionTransactionDefinition.TIMEOUT_DEFAULTpublic final void setReadOnly(boolean readOnly)
public final boolean isReadOnly()
TransactionDefinitionOnly makes sense in combination with PROPAGATION_REQUIRED or PROPAGATION_REQUIRES_NEW.
A transaction manager that cannot interpret the read-only hint will not throw an exception when given readOnly=true.
isReadOnly in interface TransactionDefinitionpublic boolean equals(java.lang.Object other)
toString()public int hashCode()
toString()public java.lang.String toString()
Has to be overridden in subclasses for correct equals and hashCode behavior. Alternatively, equals and hashCode can be overridden themselves.
TransactionAttributeEditorprotected final java.lang.StringBuffer getDefinitionDescription()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||