Wednesday, April 27, 2016

Transaction Definition

Transaction Definition

  1. PROPAGATION_REQUIRED (normally used)
    If transaction existed, use it, otherwise open a new transaction
  2. PROPAGATION_SUPPORTS
    If transaction existed, use it, otherwise run as non-transaction
  3. PROPAGATION_MANDATORY
    If transaction existed, use it, otherwise throw Exception
  4. PROPAGATION_REQUIRES_NEW
    Always open a new transaction, if transaction existed, hang up the existed transaction
  5. PROPAGATION_NOT_SUPPORTED
    Always run without transaction, if transaction existed, hang up the existed transaction
  6. PROPAGATION_NEVER
    Always run without transaction, if transaction existed, throw Exception
  7. PROPAGATION_NESTED (in Spring)
    If transaction existed, run nested transaction inside the existed transaction.
    If no transaction existed, run as PROPAGATION_REQUIRED

PropagationT1 NoneT1 Existed
REQUIREDT2=>newT1
SUPPORTST2 NoneT1
MANDATORYT2 ExceptionT1
REQUIRES_NEWT2=>newT2=>new
NOT_SUPPORTEDNoneHang up T1
NEVERNoneT2 Exception
NESTEDAs REQUIREDNested

No comments:

Post a Comment