jbonofre opened a new pull request, #1459:
URL: https://github.com/apache/arrow-java/pull/1459

   ## What's Changed
   
   Follow-up to #1441 (#1439).
   
   Expand the `try` block in `AvaticaParameterBinder.bind(List<TypedValue>, 
int)` to cover the initial parameter-count check as well as 
`parameters.setRowCount(index + 1)` and 
`preparedStatement.setParameters(parameters)` (up to `parametersHandedOff = 
true`), so that any `RuntimeException` thrown before ownership is handed off to 
the prepared statement closes `parameters`:
   
   - `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 before 
`parametersHandedOff` is set to `true`.
   
   Added unit tests in `AvaticaParameterBinderTest` covering both `setRowCount` 
(`OutOfMemoryException`) and `setParameters` (`IllegalStateException`) failures.
   
   Closes #1458.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to