ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond McDermott" <...@mcdermott.be>
Subject Re: Parsing xml-Definition For Creating SqlMapClient
Date Wed, 28 Nov 2007 19:31:32 GMT
You should think about using the Spring integration and that will take care
of your connections in a thread-safe way for you.

On 28/11/2007, Ralf Assmann <ralf.assmann@innovations.de> wrote:
>
>
> 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