Starts a transaction and tracks whether the transaction is created successfully.

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

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:

Example

<dsp:beginTransaction var="beginXA"/>
  <c:choose>
     <c:when test="${beginXA.success}">
       Transaction started <br/>
     </c:when>
     <c:otherwise>
         Transaction failed due to this exception:
            <c:out value="${beginXA.exception}"/>
     </c:otherwise>
  </c:choose>

In this example, the tag causes a transaction to begin. If the call is successful, the user sees the message Transaction started. If the call fails, the user sees the message Transaction failed due to this exception and the exception string.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved.

Legal Notices