Spring Boot 1.3.5 with Hikari Connection Pool not able to set program name in v$session

我们两清 提交于 2019-12-13 16:45:50

问题


I have a JHipster spring boot ver 1.3.5 application which connects to Oracle DB using Hikari Connection Pool. I am unable to set the program in v$session which should be possible by adding below in my application YAML

hikari:
   v$session:
     program: AppName
     username: DB_USER

I have tried adding these at spring.datasource level, datasource.hikari level and datasource level.

I also looked at Hibernate 4.3.5 ignores v$session.program configuration property but that did not work as well.

Update 1 - I tried all the below and none seem to work

spring.datasource.hikari.datasourceProperties.v$session.program AppName
spring.datasource.hikari.datasourceProperties.v$session.username    DB_USER
datasource.hikari.v$session.program AppName
datasource.hikari.v$session.username    DB_USER
datasource.hikari.datasourceProperties.v$session.program    AppName
datasource.hikari.datasourceProperties.v$session.username   DB_USER
hikari.v$session.program    AppName
hikari.v$session.username   DB_USER
hikari.datasourceProperties.v$session.program   AppName
hikari.datasourceProperties.v$session.username  DB_USER

回答1:


Following works in Spring Boot 1.5.8.RELEASE using application.yml file:

spring:
  datasource:
    hikari:
      data-source-properties:
         v$session.program: AppName


来源:https://stackoverflow.com/questions/41129486/spring-boot-1-3-5-with-hikari-connection-pool-not-able-to-set-program-name-in-v

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!