Skip to content

Commit 1de4f5b

Browse files
Specify retention of provided option values
1 parent 26d4901 commit 1de4f5b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ allows connections to be configured with values that change over time, such as a
223223
password that gets periodically rotated.
224224

225225
If a `Supplier` provides the value of an `Option`, then Oracle R2DBC requests
226-
the value by invoking `Supplier.get()` method. If the `get()` returns `null`,
226+
the value by invoking `Supplier.get()`. If `get()` returns `null`,
227227
then no value is configured for the `Option`. If `get()` throws a
228228
`RuntimeException`, then it is set as the initial cause of an
229229
`R2dbcException` emitted by the `create()` `Publisher`. If concurrent
@@ -293,6 +293,15 @@ set of options:
293293
Providing values for these options would not be interoperable with
294294
`io.r2dbc.spi.ConnectionFactories` and `r2dbc-pool`.
295295

296+
Normally, Oracle R2DBC will not retain references to `Option` values after
297+
`ConnectionFactories.create(ConnectionFactoryOptions)` returns. However, if
298+
the value of at least one `Option` is provided by a `Supplier` or `Publisher`,
299+
then Oracle R2DBC will retain a reference to all `Option` values until the
300+
`ConnectionFactory.create()` `Publisher` emits a `Connection` or error. This is
301+
important to keep in mind when `Option` values may be mutated. In particular,
302+
a password may only be cleared from memory after the `create()` `Publisher`
303+
emits a `Connection` or error.
304+
296305
#### Configuring an Oracle Net Descriptor
297306
The `oracle.r2dbc.OracleR2dbcOptions.DESCRIPTOR` option may be used to configure
298307
an Oracle Net Descriptor of the form ```(DESCRIPTION=...)```. If this option is

0 commit comments

Comments
 (0)