Skip to content

fix(bqjdbc): lazily instantiate Statement in BigQueryDatabaseMetaData#12752

Merged
Neenu1995 merged 3 commits intomainfrom
ns/dbmetadata-fix
Apr 13, 2026
Merged

fix(bqjdbc): lazily instantiate Statement in BigQueryDatabaseMetaData#12752
Neenu1995 merged 3 commits intomainfrom
ns/dbmetadata-fix

Conversation

@Neenu1995
Copy link
Copy Markdown
Contributor

@Neenu1995 Neenu1995 commented Apr 10, 2026

b/501419313

  • Remove pre-emptive BigQueryStatement object creation in BigQueryDatabaseMetData constructor.
  • Make DataBaseMetadata field in BigQueryConnection class static.

@Neenu1995 Neenu1995 requested review from a team as code owners April 10, 2026 16:25
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request refactors BigQueryDatabaseMetaData by removing the shared BigQueryStatement member and updating various metadata methods to either pass null to BigQueryJsonResultSet or use local statements. A critical issue was identified in getPrimaryKeys, getImportedKeys, and getExportedKeys, where the use of try-with-resources causes the Statement and its associated ResultSet to be closed before the caller can use them. It is recommended to use stmt.closeOnCompletion() to ensure the statement remains open until the result set is processed.

@Neenu1995 Neenu1995 changed the title fix(bqjdbc): only create Statement object when necessary in BDMetaData fix(bqjdbc): only create Statement object when necessary in DBMetaData Apr 13, 2026
@Neenu1995 Neenu1995 changed the title fix(bqjdbc): only create Statement object when necessary in DBMetaData fix(bqjdbc): lazily instantiate Statement in BigQueryDatabaseMetaData Apr 13, 2026
@Neenu1995 Neenu1995 merged commit 72e5508 into main Apr 13, 2026
114 of 115 checks passed
@Neenu1995 Neenu1995 deleted the ns/dbmetadata-fix branch April 13, 2026 20:14
diegomarquezp added a commit that referenced this pull request Apr 14, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>1.85.0</summary>

##
[1.85.0](v1.84.0...v1.85.0)
(2026-04-14)


### Features

* [appoptimize] new module for appoptimize
([#12768](#12768))
([050187d](050187d))
* [chronicle] Add DataTableService to Chronicle v1 Client Libraries
([fc62b1e](fc62b1e))
* [databasecenter] Add support for BigQuery datasets and
([fc62b1e](fc62b1e))
* [dataplex] Allow Data Documentation DataScans to support BigQuery
([fc62b1e](fc62b1e))
* [dataproc] Add `Engine` field to support LightningEngine in
([fc62b1e](fc62b1e))
* [discoveryengine] add AUTO condition to SearchAsYouTypeSpec in
([fc62b1e](fc62b1e))
* [infra-manager] adding DeploymentGroups, you can now manage
([fc62b1e](fc62b1e))
* [kms] add a variable to SingleTenantHsmInstanceCreate to control
([fc62b1e](fc62b1e))
* [kms] support external-μ in the Digest
([fc62b1e](fc62b1e))
* [shopping-merchant-products] a new field `base64_encoded_name` is
([fc62b1e](fc62b1e))
* [vectorsearch] Added CMEK support
([fc62b1e](fc62b1e))


### Bug Fixes

* **auth:** Address ClientSideCredentialAccessBoundary RefreshTask race
condition
([#12681](#12681))
([30088d2](30088d2))
* **bqjdbc:** lazily instantiate Statement in BigQueryDatabaseMetaData
([#12752](#12752))
([72e5508](72e5508))
* **deps:** update the Java code generator (gapic-generator-java) to
([fc62b1e](fc62b1e))
* **gdch:** support EC private keys
([#1896](#1896))
([bf926fb](bf926fb))
* update appoptimize version to 0.0.1 to match released repo
([#12782](#12782))
([80dfac6](80dfac6))


### Documentation

* [network-management] Update comment for the `region` field in
([fc62b1e](fc62b1e))
* [shopping-merchant-inventories] A comment for field `name` in
([fc62b1e](fc62b1e))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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