Connection unwrappedConn = null;
if (this.emUtil != null && this.emUtil.getDbType() == DbType.ORACLE && connection instanceof Proxy) {
try {
unwrappedConn = connection.unwrap(Connection.class);
} catch (Exception ex) {
throw new JuDbException("Couldn't unwrap Connection", ex);
}
}
final Connection realConn = unwrappedConn != null
? unwrappedConn
: connection;
try {
IDatabaseConnection conn = new DatabaseConnection(realConn, this.schemaName);
for (String key : this.configProperties.keySet()) {
conn.getConfig().setProperty(key, this.configProperties.get(key));
}
work.execute(conn);
} catch (DatabaseUnitException ex) {
throw new JuDbException("Couldn't execute DbUnitWork", ex);
}
}