Results 1 to 1 of 1

Thread: SpringDM Container Managed Properties issue

  1. #1

    Default SpringDM Container Managed Properties issue

    All.

    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

    Code:
    <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 mvangeertruy@comcast.net; Dec 20th, 2010 at 03:08 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •