Class TransactionTagSupport

java.lang.Object
javax.servlet.jsp.tagext.TagSupport
org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport
All Implemented Interfaces:
Serializable, IterationTag, JspTag, Tag, TryCatchFinally
Direct Known Subclasses:
TransactionTag

public abstract class TransactionTagSupport extends TagSupport implements TryCatchFinally

Tag handler for <Transaction> in JSTL.

See Also:
  • Constructor Details

    • TransactionTagSupport

      public TransactionTagSupport()
  • Method Details

    • doStartTag

      public int doStartTag() throws JspException
      Prepares for execution by setting the initial state, such as getting the Connection and preparing it for the transaction.
      Specified by:
      doStartTag in interface Tag
      Overrides:
      doStartTag in class TagSupport
      Returns:
      SKIP_BODY
      Throws:
      JspException - if an error occurs while processing this tag
      See Also:
    • doEndTag

      public int doEndTag() throws JspException
      Commits the transaction.
      Specified by:
      doEndTag in interface Tag
      Overrides:
      doEndTag in class TagSupport
      Returns:
      EVAL_PAGE
      Throws:
      JspException - if an error occurs while processing this tag
      See Also:
    • doCatch

      public void doCatch(Throwable t) throws Throwable
      Rollbacks the transaction and rethrows the Throwable.
      Specified by:
      doCatch in interface TryCatchFinally
      Parameters:
      t - The throwable exception navigating through this tag.
      Throws:
      Throwable - if the exception is to be rethrown further up the nest chain.
    • doFinally

      public void doFinally()
      Restores the Connection to its initial state and closes it.
      Specified by:
      doFinally in interface TryCatchFinally
    • release

      public void release()
      Description copied from class: TagSupport
      Release state.
      Specified by:
      release in interface Tag
      Overrides:
      release in class TagSupport
      See Also:
    • setIsolation

      public void setIsolation(String iso) throws JspTagException
      Setter method for the transaction isolation level.
      Throws:
      JspTagException
    • getSharedConnection

      public Connection getSharedConnection()
      Called by nested parameter elements to get a reference to the Connection.