title: Why is the placeholder not set properly in hikari.data-source-properties
body: <p>I am setting the <code>hikari.data-source-properties</code> with a placeholder, but the placeholder value does not get substituted. It is a spring-boot 2.1.4.RELEASE based application. My intention is to set the Session properties so the DBAs can identify my application. Currently I get a default <code>JDBC Thin Client</code> for my connection when I run <code>SELECT PROGRAM FROM V$SESSION</code> from the DB</p>
  
  <p>Below is what I have in my <code>application.yml</code> file</p>
  
  <pre><code>spring:
      datasource:
          url: "jdbc:oracle:thin:@machine:1521:service_name"
          driver-class-name: "oracle.jdbc.driver.OracleDriver"
          hikari.data-source-properties:
              v$session.program:${spring.application.name}
  </code></pre>
  
  <p>Below is what I have in my <code>bootstrap.yml</code> file</p>
  
  <pre><code>spring:
      application:
          name: ms-db-service
  </code></pre>
  
  <p>When I query the Oracle DB, I notice that the value for program is literally <code>${spring.application.name}</code>, instead of the expected value <code>ms-db-service</code></p>
  
  <p><strong>I have tried the below, with same logical result:</strong></p>
  
  <ul>
  <li>Tried redefining the <code>spring.application.name</code> again in the <code>application.yml</code></li>
  <li>Tried using a different locally defined key <code>${name}</code></li>
  <li>Added the following bean  </li>
  </ul>
  
  <pre><code>public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
      return new PropertySourcesPlaceholderConfigurer();
  }
  </code></pre>
  
  <ul>
  <li>Tried specifying the property as such: <code>spring.datasource.hikari.data-source-properties: v$session.program=${spring.application.name}</code></li>
  </ul>
  
  <p><strong>I tried the below items to gain more knowledge of the situation:</strong></p>
  
  <ul>
  <li>I tried using a placeholder for <code>spring.datasource.url</code> and that worked fine</li>
  <li>I tried to read the value manually using the below code, and that shows the correct values: <code>@Value("${spring.datasource.hikari.data-source-properties}") String propVal;</code></li>
  </ul>
  
  <p>My conclusion is that HikariCp reads these values before the placeholder substitution is done. I don't understand the relative timing of when the substitution and datasource bean creation happen in the spring-boot bean life-cycle</p>
  
  <p>I am trying to avoid using a <code>bean</code> for hikaricp datasource (not sure if that will even solve the issue), as I don't want to manually build the whole datasource as hikari supports huge number of properties.</p>
  
  <p>So, how can I set the <code>spring.datasource.hikari.data-source-properties</code> in application.yml using a placeholder. And, is there any other way to assign <code>spring.application.name</code> to identify my current db connection?</p>