ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ming Xue" <ming....@plateau.com>
Subject RE: Reload SqlMap xml file
Date Thu, 10 Nov 2005 15:44:40 GMT
thanks guys. There seem to be no easy way to handle this problem. I hope this feature can be
added into future releases.

-----Original Message-----
From: Michael Campbell [mailto:michael.campbell@gmail.com]
Sent: Wednesday, November 09, 2005 7:39 PM
To: user-java@ibatis.apache.org
Subject: Re: Reload SqlMap xml file

On 11/9/05, Paul Benedict <paul4christ79@yahoo.com> wrote:
> I have the same problem. I've seen this requested before but I don't think there is a
> --- Ming Xue <ming.xue@plateau.com> wrote:
> > Hi
> >
> > I am using Spring with SqlMap, the sqlMapClient is configured as a Spring bean,
> > development, I need to modify the sqlMap xml file (actual SQLs) very often, but
in order to
> > apply the change, I need to restart my Jboss server, so sqlMapClient can reload
those xmls. Is
> > there a way to reload sqlMap xmls without restarting server (on demand)?
> >
> > thanks
> >

I do this albeit not with iBatis.

I use spring's applicationContext (as opposed to a BeanFactory), and
generally I have an ApplicationContextManager class from which I
request the context.  It has a getContext() and clearContext() method
in it, like so.

public class AppContextManager {
  private ApplicationContext _ctx = null;

  public static ApplicationContext getContext() {
    if (_ctx == null) {
      _ctx = new FileSystem(or XML)ApplicationContext(<params go here>);

    return _ctx;

  public static void clearContext() {
    _ctx = null;

Now, whenever I need spring to re-read my config files, I just call
clearContext.  I can do this from an EJB, webservice, specific client,
servlet, whatever.

Granted, this re-reads *ALL* the spring config, and not just a
specific setting, but it does work fine.

I tend to view "truly flexible" by another term: "Make everything
equally hard". -- DHH

View raw message