Hi there,

creating a SqlMapClient for iBATIS, we use a code like this, xmlDefinition refers to the sqlMapConfig.xml-file. The connection has to be set from extern, depending on the kind of application.

   Reader reader = Resources.getResourceAsReader(xmlDefinition);
SqlMapClient sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);
   sqlMapClient.setUserConnection(aUserConnection);

Using this code in a java-server where a lot of different threads with different connections work at a time, the xml-file will be parsed every call. For this, the application is not that fast, althought the used xml-definition never changes during the call.

Is there a possibility to "cache" the sqlMapClient, but the used sqlMapClient in every thread has its own connection? Can the sqlMapClient be hold e.g. as an static variable but uses different user connections?

Many thanks.


Ralf




Reply via email to