ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: SqlMapClient factory and threadlocal?
Date Thu, 26 Oct 2006 19:37:57 GMT
You can keep it as a singleton, using either spring or a static
variable somewhere.

There is no need to keep it in a threadlocal variable.

Larry


On 26 Oct 2006 19:34:28 -0000, lodsmor02@sneakemail.com
<lodsmor02@sneakemail.com> wrote:
>
> Is there a way to avoid reparsing the configuration file every time a SqlMapClient object
is needed? From my understanding, a construct such as:
>
> Reader reader = Resources.getResourceAsReader("sqlMap-config.xml");
> SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
>
> is needed to create a SqlMapClient, but this requires a full parsing of the XML configuration
file (taking 10-30ms to process). I wonder why there's no way to cache a builder object capable
of producing SqlMapClient objects from a pre-parsed XML configuration file.
>
> Additionaly, are there any provisions to store a SqlMapClient in a ThreadLocal object,
or I must implement that?
>
> Cheers
>

Mime
View raw message