On Fri, 30 Oct 2026 17:28:56 GMT, Justin Lu <[email protected]> wrote:

>> Within `writeData`, an insert statement is being created for every inserted 
>> row. This is redundant because the insertion statement remains the same 
>> between inserted rows. (i.e., all columns are included and the values are 
>> supplied in `insertNewRow`). What is problematic is that the final insert 
>> statement is the only one being closed. Additionally, if the code throws an 
>> exception, then this final insert statement does not get closed as well.
>> 
>> This PR
>> - Ensures the statement is created only once (and closed)
>> - Ensures that if the code throws an exception, the statement is still 
>> closed. And in the case where both the original code and closing would throw 
>> an exception, the suppressed exception is attached.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Justin Lu has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Use addSupressed to mimic try-with-resources behavior

Thank you for the review Lance!

-------------

PR Comment: https://git.openjdk.org/jdk/pull/33639#issuecomment-6585989552

Reply via email to