You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Jason Zhang (JIRA)" <ib...@incubator.apache.org> on 2005/04/06 06:10:21 UTC

[jira] Created: (IBATIS-102) Some codes in the SqlMapConfigParser.java

Some codes in the SqlMapConfigParser.java
-----------------------------------------

         Key: IBATIS-102
         URL: http://issues.apache.org/jira/browse/IBATIS-102
     Project: iBatis for Java
        Type: Improvement
  Components: SQL Maps  
    Versions: 2.0.9b    
 Environment: windows2003 Server
    Reporter: Jason Zhang
    Priority: Minor


In the Class com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.java,I think some codes are unwanted:
private void addTransactionManagerNodelets() {
    //I think these codes are unwanted.
    parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
      public void process(Node node) throws Exception {
        vars.txProps = new Properties();
      }
    });
    //Because of these codes.
    parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
      public void process(Node node) throws Exception {
        vars.errorCtx.setActivity("configuring the transaction manager");

        Properties attributes = NodeletUtils.parseAttributes(node, vars.properties);


        String type = attributes.getProperty("type");
        type = vars.typeHandlerFactory.resolveAlias(type);

        TransactionManager txManager = null;
        try {
          vars.errorCtx.setMoreInfo("Check the transaction manager type or class.");
          TransactionConfig config = (TransactionConfig) Resources.instantiate(type);
          config.setDataSource(vars.dataSource);
          config.setMaximumConcurrentTransactions(vars.client.getDelegate().getMaxTransactions());
          vars.errorCtx.setMoreInfo("Check the transactio nmanager properties or configuration.");
          config.initialize(vars.txProps);
          vars.errorCtx.setMoreInfo(null);
          txManager = new TransactionManager(config);
          txManager.setForceCommit("true".equals(attributes.getProperty("commitRequired")));
        } catch (Exception e) {
          if (e instanceof SqlMapException) {
            throw (SqlMapException) e;
          } else {
            throw new SqlMapException("Error initializing TransactionManager.  Could not instantiate TransactionConfig.  Cause: " + e, e);
          }
        }

        vars.client.getDelegate().setTxManager(txManager);
      }
    });
    .........
  }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (IBATIS-102) Some codes in the SqlMapConfigParser.java

Posted by "Clinton Begin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-102?page=all ]
     
Clinton Begin closed IBATIS-102:
--------------------------------


> Some codes in the SqlMapConfigParser.java
> -----------------------------------------
>
>          Key: IBATIS-102
>          URL: http://issues.apache.org/jira/browse/IBATIS-102
>      Project: iBatis for Java
>         Type: Improvement
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: windows2003 Server
>     Reporter: Jason Zhang
>     Assignee: Brandon Goodin
>     Priority: Minor
>      Fix For: 2.1.0

>
> In the Class com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.java,I think some codes are unwanted:
> private void addTransactionManagerNodelets() {
>     //I think these codes are unwanted.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.txProps = new Properties();
>       }
>     });
>     //Because of these codes.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.errorCtx.setActivity("configuring the transaction manager");
>         Properties attributes = NodeletUtils.parseAttributes(node, vars.properties);
>         String type = attributes.getProperty("type");
>         type = vars.typeHandlerFactory.resolveAlias(type);
>         TransactionManager txManager = null;
>         try {
>           vars.errorCtx.setMoreInfo("Check the transaction manager type or class.");
>           TransactionConfig config = (TransactionConfig) Resources.instantiate(type);
>           config.setDataSource(vars.dataSource);
>           config.setMaximumConcurrentTransactions(vars.client.getDelegate().getMaxTransactions());
>           vars.errorCtx.setMoreInfo("Check the transactio nmanager properties or configuration.");
>           config.initialize(vars.txProps);
>           vars.errorCtx.setMoreInfo(null);
>           txManager = new TransactionManager(config);
>           txManager.setForceCommit("true".equals(attributes.getProperty("commitRequired")));
>         } catch (Exception e) {
>           if (e instanceof SqlMapException) {
>             throw (SqlMapException) e;
>           } else {
>             throw new SqlMapException("Error initializing TransactionManager.  Could not instantiate TransactionConfig.  Cause: " + e, e);
>           }
>         }
>         vars.client.getDelegate().setTxManager(txManager);
>       }
>     });
>     .........
>   }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (IBATIS-102) Some codes in the SqlMapConfigParser.java

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-102?page=comments#action_62462 ]
     
Brandon Goodin commented on IBATIS-102:
---------------------------------------

you are correct. The "vars.txProps = new Properties();" get's initialized in other places. But, even if it wasn't it would be totally worthless where it is at.

Thanks!

> Some codes in the SqlMapConfigParser.java
> -----------------------------------------
>
>          Key: IBATIS-102
>          URL: http://issues.apache.org/jira/browse/IBATIS-102
>      Project: iBatis for Java
>         Type: Improvement
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: windows2003 Server
>     Reporter: Jason Zhang
>     Priority: Minor

>
> In the Class com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.java,I think some codes are unwanted:
> private void addTransactionManagerNodelets() {
>     //I think these codes are unwanted.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.txProps = new Properties();
>       }
>     });
>     //Because of these codes.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.errorCtx.setActivity("configuring the transaction manager");
>         Properties attributes = NodeletUtils.parseAttributes(node, vars.properties);
>         String type = attributes.getProperty("type");
>         type = vars.typeHandlerFactory.resolveAlias(type);
>         TransactionManager txManager = null;
>         try {
>           vars.errorCtx.setMoreInfo("Check the transaction manager type or class.");
>           TransactionConfig config = (TransactionConfig) Resources.instantiate(type);
>           config.setDataSource(vars.dataSource);
>           config.setMaximumConcurrentTransactions(vars.client.getDelegate().getMaxTransactions());
>           vars.errorCtx.setMoreInfo("Check the transactio nmanager properties or configuration.");
>           config.initialize(vars.txProps);
>           vars.errorCtx.setMoreInfo(null);
>           txManager = new TransactionManager(config);
>           txManager.setForceCommit("true".equals(attributes.getProperty("commitRequired")));
>         } catch (Exception e) {
>           if (e instanceof SqlMapException) {
>             throw (SqlMapException) e;
>           } else {
>             throw new SqlMapException("Error initializing TransactionManager.  Could not instantiate TransactionConfig.  Cause: " + e, e);
>           }
>         }
>         vars.client.getDelegate().setTxManager(txManager);
>       }
>     });
>     .........
>   }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (IBATIS-102) Some codes in the SqlMapConfigParser.java

Posted by "Brandon Goodin (JIRA)" <ib...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/IBATIS-102?page=history ]
     
Brandon Goodin resolved IBATIS-102:
-----------------------------------

      Assign To: Brandon Goodin
     Resolution: Fixed
    Fix Version: 2.1.0

removed pointless code from SqlMapConfigParser:

   parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
      public void process(Node node) throws Exception {
        vars.txProps = new Properties();
      }
    }); 

> Some codes in the SqlMapConfigParser.java
> -----------------------------------------
>
>          Key: IBATIS-102
>          URL: http://issues.apache.org/jira/browse/IBATIS-102
>      Project: iBatis for Java
>         Type: Improvement
>   Components: SQL Maps
>     Versions: 2.0.9b
>  Environment: windows2003 Server
>     Reporter: Jason Zhang
>     Assignee: Brandon Goodin
>     Priority: Minor
>      Fix For: 2.1.0

>
> In the Class com.ibatis.sqlmap.engine.builder.xml.SqlMapConfigParser.java,I think some codes are unwanted:
> private void addTransactionManagerNodelets() {
>     //I think these codes are unwanted.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.txProps = new Properties();
>       }
>     });
>     //Because of these codes.
>     parser.addNodelet("/sqlMapConfig/transactionManager/end()", new Nodelet() {
>       public void process(Node node) throws Exception {
>         vars.errorCtx.setActivity("configuring the transaction manager");
>         Properties attributes = NodeletUtils.parseAttributes(node, vars.properties);
>         String type = attributes.getProperty("type");
>         type = vars.typeHandlerFactory.resolveAlias(type);
>         TransactionManager txManager = null;
>         try {
>           vars.errorCtx.setMoreInfo("Check the transaction manager type or class.");
>           TransactionConfig config = (TransactionConfig) Resources.instantiate(type);
>           config.setDataSource(vars.dataSource);
>           config.setMaximumConcurrentTransactions(vars.client.getDelegate().getMaxTransactions());
>           vars.errorCtx.setMoreInfo("Check the transactio nmanager properties or configuration.");
>           config.initialize(vars.txProps);
>           vars.errorCtx.setMoreInfo(null);
>           txManager = new TransactionManager(config);
>           txManager.setForceCommit("true".equals(attributes.getProperty("commitRequired")));
>         } catch (Exception e) {
>           if (e instanceof SqlMapException) {
>             throw (SqlMapException) e;
>           } else {
>             throw new SqlMapException("Error initializing TransactionManager.  Could not instantiate TransactionConfig.  Cause: " + e, e);
>           }
>         }
>         vars.client.getDelegate().setTxManager(txManager);
>       }
>     });
>     .........
>   }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira