org.apache.commons.jelly.tags.sql
Class TransactionTag

java.lang.Object
  extended byorg.apache.commons.jelly.TagSupport
      extended byorg.apache.commons.jelly.tags.sql.TransactionTag
All Implemented Interfaces:
org.apache.commons.jelly.Tag

public class TransactionTag
extends org.apache.commons.jelly.TagSupport

Tag handler for <Transaction> in JSTL.

Author:
Hans Bergsten

Field Summary
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
           
 
Fields inherited from class org.apache.commons.jelly.TagSupport
body, context, hasTrimmed, parent, shouldTrim
 
Constructor Summary
TransactionTag()
           
 
Method Summary
protected  void doFinally()
          Restores the Connection to its initial state and closes it.
 void doTag(org.apache.commons.jelly.XMLOutput output)
          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 setDataSource(java.lang.Object dataSource)
          Sets the SQL DataSource.
 void setIsolation(java.lang.String iso)
          Sets the transaction isolation level.
 
Methods inherited from class org.apache.commons.jelly.TagSupport
findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, findAncestorWithClass, getBody, getBodyText, getBodyText, getContext, getParent, invokeBody, isEscapeText, isTrim, setBody, setContext, setEscapeText, setParent, setTrim, trimBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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
Constructor Detail

TransactionTag

public TransactionTag()
Method Detail

setDataSource

public void setDataSource(java.lang.Object dataSource)
Sets the SQL DataSource. DataSource can be a String or a DataSource object.


doTag

public void doTag(org.apache.commons.jelly.XMLOutput output)
           throws org.apache.commons.jelly.JellyTagException
Prepares for execution by setting the initial state, such as getting the Connection and preparing it for the transaction.

Throws:
org.apache.commons.jelly.JellyTagException

setIsolation

public void setIsolation(java.lang.String iso)
                  throws org.apache.commons.jelly.JellyTagException
Sets the transaction isolation level.

Throws:
org.apache.commons.jelly.JellyTagException

getSharedConnection

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


doFinally

protected void doFinally()
Restores the Connection to its initial state and closes it.