Comments (14)
Thanks, I'll test it out later today and update.
from oracle-r2dbc.
I've tried a few various tests, but haven't been able to reproduce the failure. Here's what I've tried:
import io.r2dbc.spi.Connection;
import io.r2dbc.spi.ConnectionFactories;
import io.r2dbc.spi.ConnectionFactory;
import io.r2dbc.spi.ConnectionFactoryOptions;
import oracle.r2dbc.OracleR2dbcOptions;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import static io.r2dbc.spi.ConnectionFactoryOptions.DRIVER;
import static io.r2dbc.spi.ConnectionFactoryOptions.PASSWORD;
import static io.r2dbc.spi.ConnectionFactoryOptions.PROTOCOL;
import static io.r2dbc.spi.ConnectionFactoryOptions.USER;
public class AddressList {
public static void main(String[] args) {
// TODO: Change these to your real host, port, and service name.
String host = "TODO";
int port = 1521;
String serviceName = "TODO";
String descriptor =
"(DESCRIPTION=" +
"(ADDRESS_LIST=" +
"(ADDRESS=(PROTOCOL=TCP)(HOST=thishostdoesnotexist)(PORT=1521))" +
"(ADDRESS=(PROTOCOL=TCP)(HOST=" + host + ")(PORT=" + port + ")))" +
"(FAILOVER=on)" +
"(LOAD_BALANCE=off)" +
"(CONNECT_DATA=" +
"(SERVER=DEDICATED)" +
"(SERVICE_NAME=" + serviceName + ")))";
// Test a plain Oracle R2DBC URL
String plainUrl =
"r2dbc:oracle://?oracle.r2dbc.descriptor=" + descriptor;
testUrl(plainUrl);
// Test an R2DBC Pool URL
String poolUrl =
"r2dbc:pool:oracle://?oracle.r2dbc.descriptor=" + descriptor;
testUrl(poolUrl);
// Test programmatically configured options without R2DBC Pool
ConnectionFactoryOptions plainOptions =
ConnectionFactoryOptions.builder()
.option(DRIVER, "oracle")
.option(OracleR2dbcOptions.DESCRIPTOR, descriptor)
.build();
testOptions(plainOptions);
// Test programmatically configured options with R2DBC pool
ConnectionFactoryOptions poolOptions =
ConnectionFactoryOptions.builder()
.option(DRIVER, "pool")
.option(PROTOCOL, "oracle")
.option(OracleR2dbcOptions.DESCRIPTOR, descriptor)
.build();
testOptions(poolOptions);
}
static void testUrl(String url) {
System.out.println("Testing: " + url);
ConnectionFactoryOptions parsedOptions =
ConnectionFactoryOptions.parse(url);
testOptions(parsedOptions);
System.out.println("OK");
}
static void testOptions(ConnectionFactoryOptions options) {
// TODO: Change "test" user/password to your own. Consider reading the
// values from a secure source, rather than hardcoding them in this file.
options = options.mutate()
.option(USER, "test")
.option(PASSWORD, "test")
.build();
ConnectionFactory connectionFactory = ConnectionFactories.get(options);
Flux.usingWhen(
connectionFactory.create(),
connection -> Mono.empty(),
Connection::close)
.blockFirst();
}
}
Some theories I have:
- I wonder if that error message isn't lying? Perhaps a DATABASE option is being configured somewhere?
- Could any part of the DESCRIPTION=... contain something that needs to be percent encoded? https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding
- Are we using the same versions? I'm testing Oracle R2DBC 1.1.1, and R2DBC Pool 1.0.0.RELEASE
from oracle-r2dbc.
@Michael-A-McMahon it works ! We tried on Oracle RAC.
As far as I'm concerned you can close the issue.
Thank you very much for your support.
from oracle-r2dbc.
Hi, @antoba. Oracle R2DBC supports (DESCRIPTION=...
style URLs that can include an ADDRESS_LIST element:
https://github.com/oracle/oracle-r2dbc#configuring-an-oracle-net-descriptor
Would that work for you, or are you looking for something different?
from oracle-r2dbc.
Running into the same issue. @Michael-A-McMahon Can you give an example connection string? It does not seem to honor
whatever option tried. composeJdbcUrl method in OracleReactiveJdbcAdapter.java supports only one host.
from oracle-r2dbc.
The r2dbc:
URL should look like this:
r2dbc:oracle://?oracle.r2dbc.descriptor=(DESCRIPTION=...)
If that doesn't work, if you to share the URL you have, then I can test it. If you share a URL, it would be good to strip out any real values, like a real host name. Just use a place holder instead of real values.
from oracle-r2dbc.
@Michael-A-McMahon Here is an example that we tried. r2dbc:oracle:thin://?oracle.r2dbc.descriptor=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=a_host)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=b_host)(PORT=1521)))(FAILOVER=on)(LOAD_BALANCE=off)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=service_name)))
The error that we get is
[org/springframework/boot/autoconfigure/r2dbc/ConnectionFactoryConfigurations$PoolConfiguration$PooledConnectionFactoryConfiguration.class]: Failed to instantiate [io.r2dbc.pool.ConnectionPool]: Factory method 'connectionFactory' threw exception with message: oracle.r2dbc.descriptor Option has been specified with potentially conflicting Options: [Option{name='database', sensitive=false}]
from oracle-r2dbc.
I think it can work if you remove the ":thin" component at the beginning. Oracle R2DBC is not supposed to recognized that.
But there error message is awful; It provides no indication of what the problem is. At the very least, I will fix that.
from oracle-r2dbc.
I think we tried that but will give it a try.
This is what finally worked however we are sure its just picking one host and there is no way to specify the failover
r2dbc:oracle:thin:@tcps://a_host:1521,b_host:1521/service_name
from oracle-r2dbc.
Confirm that ":thin" has no effect. Same error as before
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [io.r2dbc.pool.ConnectionPool]: Factory method 'connectionFactory' threw exception with message: oracle.r2dbc.descriptor Option has been specified with potentially conflicting Options: [Option{name='database', sensitive=false}]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:171) ~[spring-beans-6.0.8.jar!/:6.0.8]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:655) ~[spring-beans-6.0.8.jar!/:6.0.8]
... 69 common frames omitted
Caused by: java.lang.IllegalArgumentException: oracle.r2dbc.descriptor Option has been specified with potentially conflicting Options: [Option{name='database', sensitive=false}]
from oracle-r2dbc.
Hi, @antoba. Oracle R2DBC supports
(DESCRIPTION=...
style URLs that can include an ADDRESS_LIST element: https://github.com/oracle/oracle-r2dbc#configuring-an-oracle-net-descriptorWould that work for you, or are you looking for something different?
Well, I didn't know it accepted this syntax, I'll try and eventually let you know if it works in my environment
thanks a lot for now. !
from oracle-r2dbc.
@Michael-A-McMahon Found the issue and the error indeed is correct. This is in our app properties. spring.r2dbc.name=${DB_SCHEMA} - Once we removed this, the (DESCRIPTION=
style worked. Thanks a lot!
from oracle-r2dbc.
@dataatma: Glad to hear it.
@antoba: I'll leave the issue open for while, hoping things work for you as well.
from oracle-r2dbc.
Glad to hear it!
from oracle-r2dbc.
Related Issues (20)
- option(OracleR2dbcOptions.TLS_SERVER_DN_MATCH, "false") does not work HOT 3
- Issue with the OracleR2dbcOptions.Executor option HOT 2
- Maven Repository v1.1.0 HOT 4
- Error occurs if ConnectionFactoryOptions.PROTOCOL option is an empty string HOT 1
- Oracle Descriptor Option HOT 2
- Support RETURNING * INTO HOT 2
- Unsupported Java type:class java.util.ArrayList exception when using IN clause in sql HOT 1
- Can not find oracle-r2dbc-1.1.1.pom HOT 2
- Support DML Returning for JSON Views
- Add support to set "oracle.net.kerberos5_cc_name" programmatically (for multi datasource scenarios) HOT 1
- Issue with microservice using r2dbc oracle inside kubernetes cluster. (Request timeouts) HOT 13
- Operator has been terminated issue with RowsFetchSpec and Spring DatabaseClient HOT 6
- How to configure SECURITY=(SSL_SERVER_CERT_DN) Option in R2dbc connection String with Descriptor HOT 2
- OracleReactiveJdbcAdaptor.publishConnection should timeout if Oracle JDBC connection publisher does not resolve HOT 1
- Add JavaDoc to CI Runs
- Oracle Driver Not Found - While Deploying in Tomcat Application Server HOT 7
- Support Pipelining
- Support VECTOR
- OracleR2dbcOptions doesn't support defaultRowPrefetch HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oracle-r2dbc.