Class TransactionTagSupport

  • All Implemented Interfaces:
    Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag, javax.servlet.jsp.tagext.TryCatchFinally
    Direct Known Subclasses:
    TransactionTag, TransactionTag, TransactionTag

    public abstract class TransactionTagSupport
    extends javax.servlet.jsp.tagext.TagSupport
    implements javax.servlet.jsp.tagext.TryCatchFinally

    Tag handler for <Transaction> in JSTL.

    Author:
    Hans Bergsten
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean dataSourceSpecified  
      protected Object rawDataSource  
      • Fields inherited from class javax.servlet.jsp.tagext.TagSupport

        id, pageContext
      • Fields inherited from interface javax.servlet.jsp.tagext.IterationTag

        EVAL_BODY_AGAIN
      • Fields inherited from interface javax.servlet.jsp.tagext.Tag

        EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
    • Field Detail

      • rawDataSource

        protected Object rawDataSource
      • dataSourceSpecified

        protected boolean dataSourceSpecified
    • Constructor Detail

      • TransactionTagSupport

        public TransactionTagSupport()
    • Method Detail

      • doStartTag

        public int doStartTag()
                       throws javax.servlet.jsp.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 javax.servlet.jsp.tagext.Tag
        Overrides:
        doStartTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
      • doEndTag

        public int doEndTag()
                     throws javax.servlet.jsp.JspException
        Commits the transaction.
        Specified by:
        doEndTag in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        doEndTag in class javax.servlet.jsp.tagext.TagSupport
        Throws:
        javax.servlet.jsp.JspException
      • doCatch

        public void doCatch​(Throwable t)
                     throws Throwable
        Rollbacks the transaction and rethrows the Throwable.
        Specified by:
        doCatch in interface javax.servlet.jsp.tagext.TryCatchFinally
        Throws:
        Throwable
      • doFinally

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

        public void release()
        Specified by:
        release in interface javax.servlet.jsp.tagext.Tag
        Overrides:
        release in class javax.servlet.jsp.tagext.TagSupport
      • setIsolation

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

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