[CONJ-1146] Blob has inefficient memory handling Created: 2024-01-05  Updated: 2024-01-05

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

Type: Task Priority: Major
Reporter: Robin Rönnberg Assignee: Diego Dupin
Resolution: Unresolved Votes: 0
Labels: None


 Description   

When using hibernate with MariaDB Connector/J and retrieving a blob from the database, the entier blob is loaded into memory in MariaDbBlob.class, which is undesirable when streaming the blob to an OutputStream.

blob.getBinaryStream() // entire byte[] is already loaded into memory

Inserting a large Blob into the database works good with streaming using hibernate session, without loading the entier file into memory:

blob = session.getLobHelper().createBlob(multipart.getInputStream(), multipartFile.getSize());

PostgreSQL for example does not have this property and it is possible to retrieve a "blob-stream" without having to load the entier byte array into memory. I really like MariaDB and it would be great if it is possible to implement a driver that can deliver a more memory optimized handling of blobs when streaming data.

Versions used: MariaDB 10.6 and MariaDB Connector/J 3.2


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