jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hor...@apache.org
Subject cvs commit: jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/sql TransactionTag.java
Date Thu, 11 Apr 2002 00:46:26 GMT
horwat      02/04/10 17:46:26

  Modified:    standard/src/org/apache/taglibs/standard/tag/common/sql
                        TransactionTagSupport.java
               standard/src/org/apache/taglibs/standard/tag/el/sql
                        TransactionTag.java
               standard/src/org/apache/taglibs/standard/tag/rt/sql
                        TransactionTag.java
  Log:
  Fix the transaction action's isolation attribute handling.
  
  Revision  Changes    Path
  1.5       +15 -15    jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java
  
  Index: TransactionTagSupport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/common/sql/TransactionTagSupport.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TransactionTagSupport.java	4 Apr 2002 21:49:20 -0000	1.4
  +++ TransactionTagSupport.java	11 Apr 2002 00:46:25 -0000	1.5
  @@ -82,7 +82,7 @@
   
       private static final int DEFAULT_ISOLATION = -1;
   
  -    private int transactionIsolation = DEFAULT_ISOLATION;
  +    private int isolation = DEFAULT_ISOLATION;
   
       /*
        * The following properties take expression values, so the
  @@ -104,20 +104,20 @@
       /**
        * Setter method for the transaction isolation level.
        */
  -    public void setTransactionIsolation(String transactionIsolation) 
  +    public void setIsolation(String isolation) 
   	throws JspTagException {
   
  -	if ("TRANSACTION_READ_COMMITTED".equals(transactionIsolation)) {
  -	    this.transactionIsolation = Connection.TRANSACTION_READ_COMMITTED;
  +	if ("TRANSACTION_READ_COMMITTED".equals(isolation)) {
  +	    this.isolation = Connection.TRANSACTION_READ_COMMITTED;
   	}
  -	if ("TRANSACTION_READ_UNCOMMITTED".equals(transactionIsolation)) {
  -	    this.transactionIsolation = Connection.TRANSACTION_READ_UNCOMMITTED;
  +	if ("TRANSACTION_READ_UNCOMMITTED".equals(isolation)) {
  +	    this.isolation = Connection.TRANSACTION_READ_UNCOMMITTED;
   	}
  -	if ("TRANSACTION_REPEATABLE_READ".equals(transactionIsolation)) {
  -	    this.transactionIsolation = Connection.TRANSACTION_REPEATABLE_READ;
  +	if ("TRANSACTION_REPEATABLE_READ".equals(isolation)) {
  +	    this.isolation = Connection.TRANSACTION_REPEATABLE_READ;
   	}
  -	if ("TRANSACTION_SERIALIZABLE".equals(transactionIsolation)) {
  -	    this.transactionIsolation = Connection.TRANSACTION_SERIALIZABLE;
  +	if ("TRANSACTION_SERIALIZABLE".equals(isolation)) {
  +	    this.isolation = Connection.TRANSACTION_SERIALIZABLE;
   	}
   	else {
   	    throw new JspTagException(
  @@ -151,9 +151,9 @@
   		throw new JspTagException(
                       Resources.getMessage("TRANSACTION_NO_SUPPORT"));
   	    }
  -	    if (transactionIsolation != DEFAULT_ISOLATION &&
  -		origIsolation != transactionIsolation) {
  -		conn.setTransactionIsolation(transactionIsolation);
  +	    if (isolation != DEFAULT_ISOLATION &&
  +		origIsolation != isolation) {
  +		conn.setTransactionIsolation(isolation);
   	    }
   	    conn.setAutoCommit(false);
   	}
  @@ -198,8 +198,8 @@
       public void doFinally() {
   	if (conn != null) {
   	    try {
  -		if (transactionIsolation != DEFAULT_ISOLATION &&
  -		    origIsolation != transactionIsolation) {
  +		if (isolation != DEFAULT_ISOLATION &&
  +		    origIsolation != isolation) {
   		    conn.setTransactionIsolation(origIsolation);
   		}
   		conn.setAutoCommit(true);
  
  
  
  1.4       +8 -8      jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/TransactionTag.java
  
  Index: TransactionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/el/sql/TransactionTag.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TransactionTag.java	16 Jan 2002 23:55:38 -0000	1.3
  +++ TransactionTag.java	11 Apr 2002 00:46:25 -0000	1.4
  @@ -68,14 +68,14 @@
   public class TransactionTag extends TransactionTagSupport {
       
       private String dataSourceEL;
  -    private String transactionIsolationEL;
  +    private String isolationEL;
   
       public void setDataSource(String dataSourceEL) {
   	this.dataSourceEL = dataSourceEL;
       }
   
  -    public void setTransactionIsolation(String transactionIsolationEL) {
  -	this.transactionIsolationEL = transactionIsolationEL;
  +    public void setIsolation(String isolationEL) {
  +	this.isolationEL = isolationEL;
       }
   
       public int doStartTag() throws JspException {
  @@ -85,11 +85,11 @@
   		    dataSourceEL, Object.class, this, pageContext);
   	}
   
  -	if (transactionIsolationEL != null) {
  -	    transactionIsolationEL = (String) 
  -		ExpressionEvaluatorManager.evaluate("transactionIsolation", 
  -		    transactionIsolationEL, String.class, this, pageContext);
  -            super.setTransactionIsolation(transactionIsolationEL);
  +	if (isolationEL != null) {
  +	    isolationEL = (String) 
  +		ExpressionEvaluatorManager.evaluate("isolation", 
  +		    isolationEL, String.class, this, pageContext);
  +            super.setIsolation(isolationEL);
   	}
   
   	return super.doStartTag();
  
  
  
  1.3       +13 -0     jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/sql/TransactionTag.java
  
  Index: TransactionTag.java
  ===================================================================
  RCS file: /home/cvs/jakarta-taglibs/standard/src/org/apache/taglibs/standard/tag/rt/sql/TransactionTag.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TransactionTag.java	4 Apr 2002 02:21:14 -0000	1.2
  +++ TransactionTag.java	11 Apr 2002 00:46:25 -0000	1.3
  @@ -64,6 +64,7 @@
    * @author Hans Bergsten
    */
   public class TransactionTag extends TransactionTagSupport {
  +    private String isolationRT;
       
       //*********************************************************************
       // Accessor methods
  @@ -75,5 +76,17 @@
        */
       public void setDataSource(Object dataSource) {
   	this.rawDataSource = dataSource;
  +    }
  +
  +    /**
  +     * Setter method for the Transaction Isolation level.
  +     */
  +    public void setIsolation(String isolation) {
  +	this.isolationRT = isolation;
  +    }
  +
  +    public int doStartTag() throws JspException {
  +        super.setIsolation(isolationRT);
  +        return super.doStartTag();
       }
   }
  
  
  

--
To unsubscribe, e-mail:   <mailto:taglibs-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-dev-help@jakarta.apache.org>


Mime
View raw message