Skip to content

Commit 11eba34

Browse files
committed
simplify
1 parent 35753ed commit 11eba34

File tree

1 file changed

+5
-19
lines changed

1 file changed

+5
-19
lines changed

instrumentation/jdbc/README.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,9 @@
99

1010
## Connection Pool Unwrapping
1111

12-
The JDBC instrumentation requires unwrapping pooled connections (via `java.sql.Wrapper`) to
13-
correctly attribute database operations to the underlying connection and to cache metadata. Most
14-
connection pools support this by default.
12+
The instrumentation unwraps pooled connections (via java.sql.Wrapper) to cache database metadata
13+
against the underlying physical connection. Most connection pools support this by default.
1514

16-
**Performance issue?** If unwrapping fails, the instrumentation may have degraded performance or
17-
increased overhead with some JDBC drivers. Metadata extraction may result in database queries on
18-
every operation (depending on driver implementation and caching behavior) instead of being cached,
19-
and operations may be attributed to the wrong database connection. To fix, ensure your connection
20-
pool supports unwrapping:
21-
22-
**Vibur DBCP example:**
23-
```java
24-
ds.setAllowUnwrapping(true);
25-
```
26-
27-
**Custom wrappers:** Implement `java.sql.Wrapper` correctly to delegate `isWrapperFor()` and
28-
`unwrap()` to the underlying connection.
29-
30-
**Failover note:** Cached metadata uses the unwrapped connection object as the key. If your pool
31-
reuses the same connection object after failover, telemetry may show stale host attributes.
15+
In the case that a connection pool doesn't support this, caching is limited
16+
to the wrapper instance, which typically changes each time a connection is retrieved from the pool.
17+
This can result in repeated metadata extraction, potentially causing performance degradation.

0 commit comments

Comments
 (0)