-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support including Module and Action in each JDBC session with Oracle JDBC #3183
base: 4.10.x
Are you sure you want to change the base?
Changes from 10 commits
b45b532
e0b6f4a
19e58f0
b8ed459
92902bd
afb396d
a481771
27bdc07
8bb94e8
7874bdf
41fd257
8e70480
71e66de
7a16299
2785d8d
304d577
7e90fa5
b3b0468
b8060d3
3320b38
d84dad1
1bb490a
4e98412
91b3cd6
fdff622
d56a78b
c25d742
f6b7f80
1f9e9e9
c68b657
06901f3
5adc61e
f66881f
5c97b15
da4e8a3
913d9a8
886b103
60458ad
e0099b8
e5e0c1b
7566f76
a5d01a8
9130104
8528515
c325e1b
dcfbcfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,4 +83,29 @@ | |
*/ | ||
boolean readOnly() default false; | ||
|
||
/** | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since there is |
||
* If true, then when connection is established {@link java.sql.Connection#setClientInfo(String, String)} will be called | ||
* if it is connected to the Oracle database. It will issue calls to set MODULE, ACTION and CLIENT_IDENTIFIER. | ||
* | ||
* @return whether connection should trace/set client info | ||
*/ | ||
boolean traceClientInfo() default false; | ||
|
||
/** | ||
* The module name for tracing if {@link #traceClientInfo()} is true. | ||
* If not provided, then it will fall back to the name of the class currently being intercepted in {@link io.micronaut.data.connection.interceptor.ConnectableInterceptor}. | ||
* Currently supported only for Oracle database connections. | ||
* | ||
* @return the custom module name for tracing | ||
*/ | ||
String tracingModule() default ""; | ||
|
||
/** | ||
* The action name for tracing if {@link #traceClientInfo()} is true. | ||
* If not provided, then it will fall back to the name of the method currently being intercepted in {@link io.micronaut.data.connection.interceptor.ConnectableInterceptor}. | ||
* Currently supported only for Oracle database connections. | ||
* | ||
* @return the custom module name for tracing | ||
*/ | ||
String tracingAction() default ""; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright 2017-2024 original authors | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micronaut.data.connection.support; | ||
|
||
import io.micronaut.core.annotation.NonNull; | ||
import io.micronaut.core.annotation.Nullable; | ||
|
||
/** | ||
* The connection tracing information that can be used to set to {@link java.sql.Connection#setClientInfo(String, String)}. | ||
* Currently used only for Oracle database connections. | ||
* | ||
* @param appName The app name corresponding to the micronaut.application.name config value and can be null | ||
* @param module The module | ||
* @param action The action | ||
*/ | ||
public record ConnectionTracingInfo(@Nullable String appName, @NonNull String module, @NonNull String action) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be evaluated once in a condition on startup somewhere in the
ConnectionCusotmizer
mentioned above