-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: EXPOSED-123 ExposedBlob.getBytes() fails on Oracle with IOExcept…
…ion Mark invalid (#1824) The following tests fail when run using Oracle: DDLTests/testBlob() DDLTests/testBlobDefault() EntityTests/testBlobField() They all fail with the same error: Caused by: java.io.IOException: Mark invalid or stream not marked. at oracle.jdbc.driver.OracleBlobInputStream.reset(OracleBlobInputStream.java:308) at org.jetbrains.exposed.sql.statements.api.ExposedBlob.getBytes(ExposedBlob.kt:13) The exception is thrown after a BLOB value is retrieved and read from the DB because the type retrieved is oracle.jdbc.driver.OracleBlobInputStream, which either does not set markedByte to not be default by calling mark() or invalidates mark. This makes reset() throw. This is unlike an ExposedBlob instantiated using the secondary constructor that creates a ByteArrayInputStream from a ByteArray, which overrides reset() to not throw. This exception is handled inside getBytes() to ensure that the retrieved BLOB value is still read as a stream.
- Loading branch information
Showing
3 changed files
with
26 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters