Class TransactionTagSupport
- java.lang.Object
-
- javax.servlet.jsp.tagext.TagSupport
-
- org.apache.taglibs.standard.tag.common.sql.TransactionTagSupport
-
- All Implemented Interfaces:
java.io.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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.sql.Connection
conn
protected boolean
dataSourceSpecified
private int
isolation
private int
origIsolation
protected java.lang.Object
rawDataSource
private static java.lang.String
TRANSACTION_READ_COMMITTED
private static java.lang.String
TRANSACTION_READ_UNCOMMITTED
private static java.lang.String
TRANSACTION_REPEATABLE_READ
private static java.lang.String
TRANSACTION_SERIALIZABLE
-
Constructor Summary
Constructors Constructor Description TransactionTagSupport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doCatch(java.lang.Throwable t)
Rollbacks the transaction and rethrows the Throwable.int
doEndTag()
Commits the transaction.void
doFinally()
Restores theConnection
to its initial state and closes it.int
doStartTag()
Prepares for execution by setting the initial state, such as getting theConnection
and preparing it for the transaction.java.sql.Connection
getSharedConnection()
Called by nested parameter elements to get a reference to the Connection.void
release()
void
setIsolation(java.lang.String iso)
Setter method for the transaction isolation level.
-
-
-
Field Detail
-
TRANSACTION_READ_COMMITTED
private static final java.lang.String TRANSACTION_READ_COMMITTED
- See Also:
- Constant Field Values
-
TRANSACTION_READ_UNCOMMITTED
private static final java.lang.String TRANSACTION_READ_UNCOMMITTED
- See Also:
- Constant Field Values
-
TRANSACTION_REPEATABLE_READ
private static final java.lang.String TRANSACTION_REPEATABLE_READ
- See Also:
- Constant Field Values
-
TRANSACTION_SERIALIZABLE
private static final java.lang.String TRANSACTION_SERIALIZABLE
- See Also:
- Constant Field Values
-
rawDataSource
protected java.lang.Object rawDataSource
-
dataSourceSpecified
protected boolean dataSourceSpecified
-
conn
private java.sql.Connection conn
-
isolation
private int isolation
-
origIsolation
private int origIsolation
-
-
Method Detail
-
doStartTag
public int doStartTag() throws javax.servlet.jsp.JspException
Prepares for execution by setting the initial state, such as getting theConnection
and preparing it for the transaction.- Specified by:
doStartTag
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doStartTag
in classjavax.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 interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
doEndTag
in classjavax.servlet.jsp.tagext.TagSupport
- Throws:
javax.servlet.jsp.JspException
-
doCatch
public void doCatch(java.lang.Throwable t) throws java.lang.Throwable
Rollbacks the transaction and rethrows the Throwable.- Specified by:
doCatch
in interfacejavax.servlet.jsp.tagext.TryCatchFinally
- Throws:
java.lang.Throwable
-
doFinally
public void doFinally()
Restores theConnection
to its initial state and closes it.- Specified by:
doFinally
in interfacejavax.servlet.jsp.tagext.TryCatchFinally
-
release
public void release()
- Specified by:
release
in interfacejavax.servlet.jsp.tagext.Tag
- Overrides:
release
in classjavax.servlet.jsp.tagext.TagSupport
-
setIsolation
public void setIsolation(java.lang.String iso) throws javax.servlet.jsp.JspTagException
Setter method for the transaction isolation level.- Throws:
javax.servlet.jsp.JspTagException
-
getSharedConnection
public java.sql.Connection getSharedConnection()
Called by nested parameter elements to get a reference to the Connection.
-
-