Skip to content

fix(java/driver/jni): delete JNI local references#4397

Open
lidavidm wants to merge 1 commit into
apache:mainfrom
lidavidm:jni-local-ref
Open

fix(java/driver/jni): delete JNI local references#4397
lidavidm wants to merge 1 commit into
apache:mainfrom
lidavidm:jni-local-ref

Conversation

@lidavidm

Copy link
Copy Markdown
Member

Assisted-by: Claude Opus 4.8 noreply@anthropic.com

Assisted-by: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses potential JNI local reference table overflows/leaks in the Java ADBC JNI driver by explicitly deleting JNI local references that can otherwise accumulate during long-running native calls or loops.

Changes:

  • Delete the jstring local reference in JniStringView’s destructor after releasing UTF chars.
  • In statementExecutePartitions, add a null/exception check after NewByteArray and delete the per-iteration jbyteArray local reference after passing it to Java.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lidavidm lidavidm requested a review from amoeba June 15, 2026 02:37
@lidavidm lidavidm marked this pull request as ready for review June 15, 2026 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants