Commit d28436c
fix(bigquery-jdbc): fix manual commit mode failure for non-US regions (#13285)
## Problem
Manual commit mode fails when using BigQuery JDBC with non-US datasets.
**STR (Steps to Reproduce)**
1. Create BigQuery JDBC connection
2. Set a non-US location (e.g. `EU`) via `Location` property
3. Enable session mode (`EnableSession = 1`)
4. Disable auto-commit:
```java
conn.setAutoCommit(false);
```
5. Execute a simple query:
```sql
SELECT 1;
```
**ER (Expected Result)**
- Query executes successfully in manual commit mode
- BigQuery uses configured Location (e.g. EU)
- No region mismatch errors occur
**AR (Actual Result)**
Query execution fails with:
```
GoogleJsonResponseException: 400 Bad Request
INVALID_ARGUMENT
Error: 3848323
```
**Sample java code:**
```java
String jdbcUrl =
"jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443";
Properties props = new Properties();
props.put("OAuthType", "0");
props.put("OAuthPvtKeyPath", "<key-file-path>");
props.put("ProjectId", "<project-id>");
props.put("Location", "EU");
props.put("EnableSession", "1");
try (Connection conn = DriverManager.getConnection(jdbcUrl, props)) {
conn.setAutoCommit(false);
try (PreparedStatement ps = conn.prepareStatement("SELECT 1;")) {
ps.execute();
}
}
```
Co-authored-by: Jin Seop Kim <jinseop@google.com>1 parent 8a9fab9 commit d28436c
2 files changed
Lines changed: 7 additions & 2 deletions
File tree
- java-bigquery/google-cloud-bigquery/src
- main/java/com/google/cloud/bigquery
- test/java/com/google/cloud/bigquery/spi/v2
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
419 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
420 | 423 | | |
421 | 424 | | |
422 | 425 | | |
| |||
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
| 798 | + | |
| 799 | + | |
798 | 800 | | |
799 | 801 | | |
800 | 802 | | |
| |||
804 | 806 | | |
805 | 807 | | |
806 | 808 | | |
807 | | - | |
| 809 | + | |
808 | 810 | | |
809 | 811 | | |
810 | 812 | | |
| |||
0 commit comments