Class OracleSessionProgramHelper

java.lang.Object
io.micronaut.jdbc.OracleSessionProgramHelper

@Internal public final class OracleSessionProgramHelper extends Object
Shared helper to apply Oracle session program (v$session.program) consistently across JDBC pools.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    apply(String dataSourceName, String url, String dialect, io.micronaut.context.env.Environment environment, BiConsumer<String,String> addConnectionProperty, BooleanSupplier alreadyProvided)
    Applies the v$session.program property to the given connection properties if the following conditions are met: The dialect is 'oracle' or the URL starts with 'jdbc:oracle' The property 'datasources.{dataSourceName}.oracle.session.enabled' is true (default) The 'micronaut.application.name' property is non-empty The 'v$session.program' property is not already provided

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • apply

      public static boolean apply(String dataSourceName, String url, String dialect, io.micronaut.context.env.Environment environment, BiConsumer<String,String> addConnectionProperty, BooleanSupplier alreadyProvided)
      Applies the v$session.program property to the given connection properties if the following conditions are met:
      • The dialect is 'oracle' or the URL starts with 'jdbc:oracle'
      • The property 'datasources.{dataSourceName}.oracle.session.enabled' is true (default)
      • The 'micronaut.application.name' property is non-empty
      • The 'v$session.program' property is not already provided
      Parameters:
      dataSourceName - the name of the data source
      url - the JDBC URL
      dialect - the database dialect
      environment - the Micronaut environment
      addConnectionProperty - a consumer to add a connection property
      alreadyProvided - a supplier indicating whether the 'v$session.program' property is already provided
      Returns:
      true if the 'v$session.program' property was applied, false otherwise