public abstract class TransactionTagSupport
extends javax.servlet.jsp.tagext.TagSupport
implements javax.servlet.jsp.tagext.TryCatchFinally
Tag handler for <Transaction> in JSTL.
Modifier and Type | Field and 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 and Description |
---|
TransactionTagSupport() |
Modifier and Type | Method and Description |
---|---|
void |
doCatch(java.lang.Throwable t)
Rollbacks the transaction and rethrows the Throwable.
|
int |
doEndTag()
Commits the transaction.
|
void |
doFinally()
Restores the
Connection to its initial state and
closes it. |
int |
doStartTag()
Prepares for execution by setting the initial state, such as
getting the
Connection 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.
|
private static final java.lang.String TRANSACTION_READ_COMMITTED
private static final java.lang.String TRANSACTION_READ_UNCOMMITTED
private static final java.lang.String TRANSACTION_REPEATABLE_READ
private static final java.lang.String TRANSACTION_SERIALIZABLE
protected java.lang.Object rawDataSource
protected boolean dataSourceSpecified
private java.sql.Connection conn
private int isolation
private int origIsolation
public int doStartTag() throws javax.servlet.jsp.JspException
Connection
and preparing it for
the transaction.doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
public void doCatch(java.lang.Throwable t) throws java.lang.Throwable
doCatch
in interface javax.servlet.jsp.tagext.TryCatchFinally
java.lang.Throwable
public void doFinally()
Connection
to its initial state and
closes it.doFinally
in interface javax.servlet.jsp.tagext.TryCatchFinally
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
public void setIsolation(java.lang.String iso) throws javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspTagException
public java.sql.Connection getSharedConnection()