Rolls back the current transaction.

<dsp:rollbackTransaction var-spec>
   ...
</dsp:rollbackTransaction>

Attributes

var-spec

An EL variable or scripting variable that is defined with one of these attributes:

Attribute

Description

var

Names an EL variable. When you use var, you can set its scope attribute to page, request, session, or application. The default scope is page. For more information, see EL Variable Scopes.

id

Names a scripting variable that scriptlets and expressions can access at runtime.

The variable has two properties:

Usage Notes

dsp:rollbackTransaction causes the tasks associated with the current transaction to halt processing and return to their pre-transaction state. This tag tracks whether the rollback action is successful and when it is not, provides a Throwable exception object. This tag creates an EL variable that can be referenced by later tags, and provides access to the referenced object’s success and exception properties.

Example

<dsp:rollbackTransaction var="rollbackXA"/>
  <c:choose>
     <c:when test="${rollbackXA.success}">
         Your band uniform order was canceled.
     </c:when>
     <c:otherwise>
        Your band uniform order could not be canceled. Here's why:
           <c:out value="${rollbackXA.exception}"/>
     </c:otherwise
  </c:choose>

In this example, if a particular transaction is successfully rolled back, the user sees the message Your band uniform order was canceled. If the transaction is not successfully rolled back, the user sees the second message string Your band uniform order was canceled. Here's why: and the exception.


Copyright © 1997, 2015 Oracle and/or its affiliates. All rights reserved. Legal Notices