Skip to content

Commit 0bbedb7

Browse files
committed
ConnectionPool needs unwrap
1 parent 905f878 commit 0bbedb7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,18 @@ private void initialiseDatabase() throws SQLException {
245245
*/
246246
@Override
247247
public boolean isWrapperFor(Class<?> arg0) {
248-
return false;
248+
return ConnectionPool.class.isAssignableFrom(arg0);
249249
}
250250

251251
/**
252252
* Not Implemented.
253253
*/
254254
@Override
255255
public <T> T unwrap(Class<T> arg0) throws SQLException {
256-
throw new SQLException("Not Implemented");
256+
if (ConnectionPool.class.isAssignableFrom(arg0)) {
257+
return (T) this;
258+
}
259+
throw new SQLException("Not a wrapper for " + arg0.getName());
257260
}
258261

259262
/**

0 commit comments

Comments
 (0)