|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<TransactionDemarcation>
net.sourceforge.hivetranse.transaction.TransactionDemarcation
public enum TransactionDemarcation
Defines the transaction demarcation for an executable scope (method of a
service).
This class is not intended for use by application developers, but is used
by the Transaction Interceptors (read from their configuration) to notify
the TransactionService
of scope enter or leave.
The existing demarcations are copied from EJB declarative demarcation for Container-Managed Transactions.
Enum Constant Summary | |
---|---|
Mandatory
Indicates that the scope requires that a transaction already exists, ie, if no transaction exists, an exception will be thrown at scope entry. |
|
Never
Indicates that the scope refuses to work if a transaction already exists, ie, if one transaction exists, an exception will be thrown at scope entry. |
|
NotSupported
Indicates that the scope does not support transaction, ie, if one transaction currently exists, it is suspended until the end of that scope. |
|
Required
Indicates that the scope requires a transaction, ie, if one transaction currently exists, it is used, else a new transaction is created. |
|
RequiresNew
Indicates that the scope requires a new transaction, ie, if there is one current transaction or not, anyway, a new transaction will be created specifically for this scope. |
|
Supports
Indicates that the scope supports a transaction, ie, if one transaction currently exists, it may be used, if none exists, this will not be a problem for the code in this scope. |
Method Summary | |
---|---|
static TransactionDemarcation |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static TransactionDemarcation[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final TransactionDemarcation NotSupported
public static final TransactionDemarcation Required
public static final TransactionDemarcation Supports
This demarcation should be avoided, because we wonder how a piece of code can one time live without transaction, and other time live with one.
public static final TransactionDemarcation RequiresNew
Please note that the behavior here is different from the EJB world, where an exception would be thrown if there is no current transaction.
public static final TransactionDemarcation Mandatory
public static final TransactionDemarcation Never
Method Detail |
---|
public static final TransactionDemarcation[] values()
for(TransactionDemarcation c : TransactionDemarcation.values()) System.out.println(c);
public static TransactionDemarcation valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |