<dsp:beginTransaction var-spec>



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




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.


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

The variable has one of the following properties:

See Usage Notes for more information on these status codes.

Usage Notes

dsp:transactionStatus retrieves the status of the active transaction and saves that status the specified variable’s statusString property. Other tags can query the variable for transaction status information. If the tag is unable to access status information, the success property is set to false and the exception property holds a Throwable exception.

The variable can be tested for one of the following Boolean properties:


Indicates whether the transaction is in its early stages of operation and has not received any instructions about how to end.


Indicates whether tasks associated with the transaction executed, any changes made to a database(s) as a result were saved, and the transaction ended.


Indicates whether tasks associated with the database are in the process of committing. It is most likely that the transaction involves multiple databases, of which some have committed data and others do not.


Indicates whether the transaction has been instructed that, when it is prompted to end, it must revert the database(s) to its pre-transaction state (rollback).


Indicates whether any transaction is associated with current request thread.


Indicates whether each database involved in the transaction has verified that it can commit the transaction without any errors.


Indicates whether each database involved in the transaction is investigating whether it can commit the tasks associated with the transaction.


Indicates whether the tasks associated with the transaction did not complete and so no changes were made by the transaction. The transaction ended.


Indicates whether that the transaction is in the process of undoing any tasks that it performed, so no changes are saved.


Indicates whether the transaction manager can recognize the status of any other status properties.


<dsp:transactionStatus var="statusXA"/>
    <c:when test="${statusXA.committed}">
      Congratulations! You will graduate this June!

    <c:when test="${statusXA.rolledBack}">
      You will not graduate this year. Be sure to enroll in classes for
      next semester.

      It takes 10 days to gather your records and process them. Check
      again in a few days.

In this example, the status of the transaction determines the message a user sees. The transaction status is set in the EL variable statusXA that is defined by dsp:transactionStatus. When the status is rolledback users see one message, when it is committed they see another. All other transaction statuses provide the same in process notification to their recipients.

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