[ 
https://issues.apache.org/jira/browse/IBATIS-270?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466035
 ] 

Abdullah Kauchali commented on IBATIS-270:
------------------------------------------

Richard, 

Looking at this method from the class DynamicSqlMapExecutorDelegate.java:

    public synchronized void loadResource(String resourcePath) throws 
IOException, NodeletException {
        if(loadedResources.contains(resourcePath)) throw new 
IllegalStateException("The resource had already been loaded.");

        Misc.Vars v = new Misc.Vars();
        v.errorCtx.setActivity("loading the SQL Map resource");
        v.errorCtx.setResource(resourcePath);
        v.client = new DynamicSqlMapClient(this);  <== [*]
        v.delegate = this;
        v.typeHandlerFactory = getTypeHandlerFactory();
         
 ...
   
    }

The line indicated above creates a new instance of SqlMapClientImpl (in this 
case a decedant of it) every time loadResource is called.  Isn't this a problem 
if we are going to create SqlMapClient as either a static variable or a 
singleton for the entire application?

Regards

A

> Loading SqlMap XML to existing SqlMapClient
> -------------------------------------------
>
>                 Key: IBATIS-270
>                 URL: https://issues.apache.org/jira/browse/IBATIS-270
>             Project: iBatis for Java
>          Issue Type: New Feature
>          Components: SQL Maps
>         Environment: any
>            Reporter: Richard Lin
>            Priority: Minor
>         Attachments: DynamicSqlMapClient.java, 
> DynamicSqlMapExecutorDelegate.java
>
>
> Ability to dynamically load more SqlMap XML files not included in 
> sqlmap-config.xml.

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

        

Reply via email to