Skip to content

Commit ca14f5c

Browse files
Set decimal 1GB default LOB prefetch
1 parent 4b2ec1f commit ca14f5c

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/main/java/oracle/r2dbc/impl/OracleReactiveJdbcAdapter.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -648,15 +648,13 @@ private static void configureJdbcDefaults(OracleDataSource oracleDataSource) {
648648
setPropertyIfAbsent(oracleDataSource,
649649
OracleConnection.CONNECTION_PROPERTY_IMPLICIT_STATEMENT_CACHE_SIZE, "25");
650650

651-
// Prefetch LOB values by default. The database's maximum supported
652-
// prefetch size, 1GB, is configured by default. This is done so that
653-
// Row.get(...) can map LOB values into ByteBuffer/String without a
654-
// blocking database call. If the entire value is prefetched, then JDBC
655-
// won't need to fetch the remainder from the database when the entire is
656-
// value requested as a ByteBuffer or String.
651+
// Prefetch LOB values by default. This allows Row.get(...) to map most LOB
652+
// values into ByteBuffer/String without a blocking database call to fetch
653+
// the remaining bytes. 1GB is configured by default, as this is close to
654+
// the maximum allowed by the Autonomous Database service.
657655
setPropertyIfAbsent(oracleDataSource,
658656
OracleConnection.CONNECTION_PROPERTY_DEFAULT_LOB_PREFETCH_SIZE,
659-
"1073741824");
657+
"1000000000");
660658

661659
// TODO: Disable the result set cache? This is needed to support the
662660
// SERIALIZABLE isolation level, which requires result set caching to be

src/test/java/oracle/r2dbc/impl/OracleLargeObjectsTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -729,9 +729,8 @@ public void run() {
729729
+ " PRIMARY KEY(id))"));
730730

731731
// Insert two rows of LOBs larger than 1MB
732-
byte[] bytes = new byte[lobSize];
732+
byte[] bytes = getBytes(lobSize);
733733
ByteBuffer blobValue = ByteBuffer.wrap(bytes);
734-
Arrays.fill(bytes, (byte)'a');
735734
String clobValue = new String(bytes, US_ASCII);
736735
awaitUpdate(List.of(1,1), connection.createStatement(
737736
"INSERT INTO testLobPrefetch (blobValue, clobValue)"

0 commit comments

Comments
 (0)