Catch `AbstractMethodError` when trying to unwrap jdbc connection
jdts throws this exception since they just have 'stub' umplementation.
This commit is contained in:
parent
8a066de772
commit
15024915bf
|
@ -70,9 +70,10 @@ public final class PreparedStatementInstrumentation extends Instrumenter.Default
|
||||||
if (connection.isWrapperFor(Connection.class)) {
|
if (connection.isWrapperFor(Connection.class)) {
|
||||||
connection = connection.unwrap(Connection.class);
|
connection = connection.unwrap(Connection.class);
|
||||||
}
|
}
|
||||||
} catch (final Exception e) {
|
} catch (final Exception | AbstractMethodError e) {
|
||||||
// perhaps wrapping isn't supported?
|
// perhaps wrapping isn't supported?
|
||||||
// ex: org.h2.jdbc.JdbcConnection v1.3.175
|
// ex: org.h2.jdbc.JdbcConnection v1.3.175
|
||||||
|
// or: jdts.jdbc which always throws `AbstractMethodError` (at least up to version 1.3)
|
||||||
// Stick with original connection.
|
// Stick with original connection.
|
||||||
}
|
}
|
||||||
} catch (final Throwable e) {
|
} catch (final Throwable e) {
|
||||||
|
|
|
@ -71,9 +71,10 @@ public final class StatementInstrumentation extends Instrumenter.Default {
|
||||||
if (connection.isWrapperFor(Connection.class)) {
|
if (connection.isWrapperFor(Connection.class)) {
|
||||||
connection = connection.unwrap(Connection.class);
|
connection = connection.unwrap(Connection.class);
|
||||||
}
|
}
|
||||||
} catch (final Exception e) {
|
} catch (final Exception | AbstractMethodError e) {
|
||||||
// perhaps wrapping isn't supported?
|
// perhaps wrapping isn't supported?
|
||||||
// ex: org.h2.jdbc.JdbcConnection v1.3.175
|
// ex: org.h2.jdbc.JdbcConnection v1.3.175
|
||||||
|
// or: jdts.jdbc which always throws `AbstractMethodError` (at least up to version 1.3)
|
||||||
// Stick with original connection.
|
// Stick with original connection.
|
||||||
}
|
}
|
||||||
} catch (final Throwable e) {
|
} catch (final Throwable e) {
|
||||||
|
|
Loading…
Reference in New Issue