Announcement Announcement Module

Spring Dynamic Modules forum decommissioned in favor of Eclipse Gemini Blueprint

With the official first release of Eclipse Gemini Blueprint shipped, the migration of the Spring Dynamic Modules code base to the Eclipse Foundation, as part of the Gemini project, has been completed.

As such, this forum has been decommissioned in favour of the Eclipse Gemini forums.
See more
See less
SpringDM Container Managed Properties issue Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SpringDM Container Managed Properties issue


    In my app, I have a service that connects to a database via Hibernate. I would like to have this service consume changes made to an external configuration file and implement those changes at runtime. An example of why this would be needed is if we needed to turn on hibernate.show_sql operationally to help diagnose an issue.

    Hibernate's LocalSessionFactoryBean accepts a number of properties, one of which is an argument called "hibernateProperties" and is a Properties object. This object holds a number of properties, including "hibernate.show_sql". Unfortunately, because "hibernate.show_sql" is a property of a property (the Properties object), I cannot simply do an

    <osgix:managed-properties persistent-id="myApp.connector" update-strategy="container-managed"/>
    When the external configuration file is changed, this will reset the properties in my service, but it will not restart the service, so the values are not used.

    Additionally, because the properties have characters that are not valid for Java methods or attributes (the "." character), I cannot simply create a pojo extending Properties to hold the properties, and inject that object into the "hibernateProperties" property.

    So, my question is, how does one use "managed-properties" in this situation? It was suggested I use blueprint, but I'm not ready to abandon SpringDM yet. Any suggestions?
    Last edited by [email protected]; Dec 20th, 2010, 03:08 PM.