Announcement Announcement Module
Collapse
No announcement yet.
Reloading Hibernate configuration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Reloading Hibernate configuration

    I have Hibernate named queries in HBM.XML files and during development queries change in HBM.XML files.

    Is it possible to reload HBM.XML file at run-time so changed queries would be visible?

    I am using Spring 1.2 + Hibernate 3 with OpenSessionInViewFilter.

    Regards,
    Borut

  • #2
    AFAIK, the queries are cached internally by Hibernate and I'm not aware of any switch that disable this behavior. The only solution (but a heavy one) will be manually reinitialize the factory which I guess is almost as doing a redeploy without any hassle.
    Try the HB forums and ask for such a feature

    Comment


    • #3
      Currently I am trying to reinitialize LocalSessionFactoryBean to make this work but I am having a hard time.
      I got Configuration (cfg) object from LocalSessionFactoryBean, but when I call cfg.buildSessionFactory(), I get the error:

      Code:
      org.hibernate.HibernateException: No local DataSource found for configuration - dataSource property must be set on LocalSessionFactoryBean
      How would I force Spring/Hibernate to refresh Hibernate configuration?

      Where do you guys keep your queries? I find the solution of queries in code not very practical.

      Thanks costin 4 your reply. Tried Hibernate forums but no reply.

      Regards,
      B

      Comment

      Working...
      X