Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-1146

Blob has inefficient memory handling

    XMLWordPrintable

Details

    • Task
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • None
    • 3.6
    • None
    • 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

      Attachments

        Issue Links

          Activity

            People

              diego dupin Diego Dupin
              ronnberg Robin Rönnberg
              Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.