[CONJ-651] org.mariadb.jdbc.internal.com.read.resultset.getCharacterStream() loads everything into RAM before returns stream and as result - OutOfMemoryError Created: 2018-10-02  Updated: 2020-03-23

Status: Open
Project: MariaDB Connector/J
Component/s: Other
Affects Version/s: 2.3.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ilya Zhavoronkov Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Java 8, Windows/RedHat



 Description   

getCharacterStream() loads the field fully into RAM and only then returns stream.
This is completely useless, misleading and leads to OutOfMemoryError.



 Comments   
Comment by Ilya Zhavoronkov [ 2018-10-18 ]

Any news?

Comment by Diego Dupin [ 2018-11-07 ]

There can be a possibility: like .net option SequentialAccess (see https://docs.microsoft.com/en-us/dotnet/api/system.data.commandbehavior?view=netframework-4.7.2), but that means reading data sequentially (i.e. only read data of columns sequentially, or stream will be completely loaded)

Comment by Vladislav Vaintroub [ 2018-11-07 ]

JFYI, there is a restriction in .NET of what SequentialAccess can do, due to its strict forward-reading behavior, e.g same column can not be read twice, and also columns must to be read in the same order as they appear in the result set row. Since the behavior is not 100% JDBC-conform, if implemented within driver, this would probably need some special option, like setFetchSize() (e.g with some negative number)

Generated at Thu Feb 08 03:17:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.