Skip to content

[JDBC] Close parameter VectorSchemaRoot if setRowCount or setParameters fails in AvaticaParameterBinder #1458

Open

Description

@jbonofre

Follow-up to #1441 (#1439).

In AvaticaParameterBinder.bind(List<TypedValue>, int), the try block that closes parameters on failure before hand-off currently only wraps the per-parameter bind loop:

  • parameters.setRowCount(index + 1) calls setValueCount on each vector, which can still allocate buffers (for example, child vector buffers of a FixedSizeListVector when null was bound) and throw OutOfMemoryException.
  • preparedStatement.setParameters(parameters) can also throw a RuntimeException before parametersHandedOff is set to true.
  • The initial parameter count check throws IllegalStateException before parameters is handed off.

Expanding the try block to cover the full bind method up to parametersHandedOff = true ensures parameters is always closed on any RuntimeException before ownership is transferred to the statement.

Activity

  1. added this to the 20.0.0 milestone on Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions