Class TransactionTagSupport
- java.lang.Object
-
- jakarta.servlet.jsp.tagext.TagSupport
-
- org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport
-
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag,jakarta.servlet.jsp.tagext.JspTag,jakarta.servlet.jsp.tagext.Tag,jakarta.servlet.jsp.tagext.TryCatchFinally,Serializable
- Direct Known Subclasses:
TransactionTag,TransactionTag
public abstract class TransactionTagSupport extends jakarta.servlet.jsp.tagext.TagSupport implements jakarta.servlet.jsp.tagext.TryCatchFinallyTag handler for <Transaction> in JSTL.
- Author:
- Hans Bergsten
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleandataSourceSpecifiedprotected ObjectrawDataSource
-
Constructor Summary
Constructors Constructor Description TransactionTagSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoCatch(Throwable t)Rollbacks the transaction and rethrows the Throwable.intdoEndTag()Commits the transaction.voiddoFinally()Restores theConnectionto its initial state and closes it.intdoStartTag()Prepares for execution by setting the initial state, such as getting theConnectionand preparing it for the transaction.ConnectiongetSharedConnection()Called by nested parameter elements to get a reference to the Connection.voidrelease()voidsetIsolation(String iso)Setter method for the transaction isolation level.
-
-
-
Field Detail
-
rawDataSource
protected Object rawDataSource
-
dataSourceSpecified
protected boolean dataSourceSpecified
-
-
Method Detail
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionPrepares for execution by setting the initial state, such as getting theConnectionand preparing it for the transaction.- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionCommits the transaction.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Throws:
jakarta.servlet.jsp.JspException
-
doCatch
public void doCatch(Throwable t) throws Throwable
Rollbacks the transaction and rethrows the Throwable.- Specified by:
doCatchin interfacejakarta.servlet.jsp.tagext.TryCatchFinally- Throws:
Throwable
-
doFinally
public void doFinally()
Restores theConnectionto its initial state and closes it.- Specified by:
doFinallyin interfacejakarta.servlet.jsp.tagext.TryCatchFinally
-
release
public void release()
- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classjakarta.servlet.jsp.tagext.TagSupport
-
setIsolation
public void setIsolation(String iso) throws jakarta.servlet.jsp.JspTagException
Setter method for the transaction isolation level.- Throws:
jakarta.servlet.jsp.JspTagException
-
getSharedConnection
public Connection getSharedConnection()
Called by nested parameter elements to get a reference to the Connection.
-
-