ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralf Assmann <ralf.assm...@innovations.de>
Subject Parsing xml-Definition For Creating SqlMapClient
Date Wed, 28 Nov 2007 16:53:39 GMT

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





Mime
View raw message