Skip to content

Commit 9913c94

Browse files
committed
Call beginRequest on innerMostDelegate
1 parent 736cf26 commit 9913c94

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

src/main/java/org/apache/commons/dbcp2/DelegatingConnection.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,17 @@ public void abort(final Executor executor) throws SQLException {
131131
protected void activate() {
132132
closed = false;
133133
setLastUsed();
134-
if (beginRequest != null && connection != null) {
135-
try {
136-
beginRequest.invoke(connection);
137-
} catch (InvocationTargetException | IllegalAccessException ex) {
138-
log.warn("Error calling beginRequest on connection", ex);
139-
}
140-
}
134+
141135
if (connection instanceof DelegatingConnection) {
142136
((DelegatingConnection<?>) connection).activate();
137+
} else {
138+
if (beginRequest != null && connection != null) {
139+
try {
140+
beginRequest.invoke(connection);
141+
} catch (InvocationTargetException | IllegalAccessException ex) {
142+
log.warn("Error calling beginRequest on connection", ex);
143+
}
144+
}
143145
}
144146
}
145147

0 commit comments

Comments
 (0)