Class OracleSessionProgramHelper
java.lang.Object
io.micronaut.jdbc.OracleSessionProgramHelper
Shared helper to apply Oracle session program (v$session.program)
consistently across JDBC pools.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapply(String dataSourceName, String url, String dialect, io.micronaut.context.env.Environment environment, BiConsumer<String, String> addConnectionProperty, BooleanSupplier alreadyProvided) Applies thev$session.programproperty 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
-
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 thev$session.programproperty 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 sourceurl- the JDBC URLdialect- the database dialectenvironment- the Micronaut environmentaddConnectionProperty- a consumer to add a connection propertyalreadyProvided- a supplier indicating whether the 'v$session.program' property is already provided- Returns:
- true if the 'v$session.program' property was applied, false otherwise
-