R2DBC Oracle

367 views
Skip to first unread message

Randula Dela

unread,
Apr 9, 2021, 6:41:30 AM4/9/21
to r2dbc
Dear All,

does anyone know how to set  R2dbcDialect for oracle in Spring Boot WebFlux

@Override
@Bean
public ConnectionFactory connectionFactory() {
ConnectionFactoryOptions baseOptions = ConnectionFactoryOptions.parse(environment.getProperty("spring.r2dbc.url"));
ConnectionFactoryOptions.Builder ob = ConnectionFactoryOptions.builder().from(baseOptions);
if (!StringUtil.isNullOrEmpty(environment.getProperty("spring.r2dbc.username"))) {
ob = ob.option(ConnectionFactoryOptions.USER, environment.getProperty("spring.r2dbc.username"));
}
if (!StringUtil.isNullOrEmpty(environment.getProperty("spring.r2dbc.password"))) {
ob = ob.option(ConnectionFactoryOptions.PASSWORD, environment.getProperty("spring.r2dbc.password"));
}
return ConnectionFactories.get(ob.build());

}

@Override
public R2dbcDialect getDialect(ConnectionFactory connectionFactory) {
return super.getDialect(connectionFactory);
}


getting me an error

Caused by: org.springframework.data.r2dbc.dialect.DialectResolver$NoDialectException: Cannot determine a dialect for Oracle Database using ConnectionPool[Oracle Database]. Please provide a Dialect.


Michael McMahon

unread,
Apr 12, 2021, 1:52:36 PM4/12/21
to r2dbc
I've looked into this a bit, and it seems that Spring R2DBC would need an implementation of the R2dbcDialect API for Oracle R2DBC:

I don't know too much about Spring R2DBC, so I can't say precisely how to go about implementing R2dbcDialect and hooking it up to the DialectResolver.

Mark Paluch

unread,
Apr 12, 2021, 4:32:03 PM4/12/21
to r2dbc
The latest version of Spring Framework (5.3.6, https://github.com/spring-projects/spring-framework/releases/tag/v5.3.5) already ships with that change. The easiest way to fix the issue is upgrading to the latest Spring Boot Version. 

Please note that this mailing list isn’t specific to Spring. Feel free to ask on Spring's Gitter channels (https://gitter.im/spring-projects/spring-data) or Stack overflow if the problem persists. 

Cheers,
Mark
--
You received this message because you are subscribed to the Google Groups "r2dbc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r2dbc+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/r2dbc/1552a42a-17ca-4193-bfda-06acf2bafac7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages