On 11/9/05, Paul Benedict <[EMAIL PROTECTED]> wrote:
> I have the same problem. I've seen this requested before but I don't think 
> there is a solution.
>
> --- Ming Xue <[EMAIL PROTECTED]> wrote:
>
> > Hi
> >
> > I am using Spring with SqlMap, the sqlMapClient is configured as a Spring 
> > bean, during
> > 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

Reply via email to