Skip to content

Commit 151cf1d

Browse files
committed
fix(bigquery-jdbc): add connection state reset hook and async abort support
- Add package-private BigQueryConnection.resetForReuse() to close open statements, reset autoCommit to true, roll back active transactions without starting a follow-up transaction, abort driver-created sessions even when the calling thread is interrupted, preserve un-aborted session/transaction state on interrupted RPCs for physical teardown, clear clientInfo and SQLWarnings, and restore holdability. - Pass startNextTransaction=false from closeImpl() so physical close does not start a new transaction on caller-managed sessions, and register MDC in close(). - Execute physical teardown asynchronously via Executor in BigQueryConnection.abort(Executor) after marking isClosed synchronously, and honor configured Timeout on transaction commit/rollback job waits. - Track optional pooled logical Connection owner on BigQueryStatement so ResultSet.getStatement().getConnection() returns the logical handle.
1 parent 44dbda5 commit 151cf1d

4 files changed

Lines changed: 610 additions & 58 deletions

File tree

‎java-bigquery-jdbc/src/main/java/com/google/cloud/bigquery/jdbc/BigQueryBaseResultSet.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ public int getConcurrency() throws SQLException {
290290
@Override
291291
public Statement getStatement() throws SQLException {
292292
checkClosed();
293-
return this.statement;
293+
if (this.statement == null) {
294+
return null;
295+
}
296+
Statement proxy = this.statement.getLogicalStatementProxy();
297+
return proxy != null ? proxy : this.statement;
294298
}
295299

296300
@Override

0 commit comments

Comments
 (0)