Skip to content

Why does ValueVarBinary impose a maximum length of 1 MiB #3457

@jamesagnew

Description

@jamesagnew

I maintain HAPI FHIR which uses H2 database (via Hibernate) as its default option.

We've had a few reports now of code breaking after the upgrade to H2 2.x. I finally tracked the issue down to this line:

https://github.com/h2database/h2database/blob/master/h2/src/main/org/h2/value/ValueVarbinary.java#L33

We use Hibernate to store binary blobs which are often 2-3 MB in size. I'm wondering why H2 explicitly forbids supplying a LOB as a byte[] unless it is less than 1 MiB. Obviously there is a threshold beyond which it makes much more sense to use a streaming parameter instead of a byte array, but on a system with a reasonable amount of memory this 1mb limit seems artifically low. Would a pull request to increase this limit be accepted?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions