Skip to content

JDBC driver creates new Session on statment exe when autocommit=true #13787

Description

@rooneyp

Issue Details

In the old Simba driver when Sessions are enabled on a connection, and autoCommit is true.
As expected, the same sessionId is returned on multiple calls to SELECT '@@session_id AS session_id'

On v 1.1.0 of the new JDBC driver, it returns a new SessionID on each call.
Is this a new driver design choice?

Example

try (Statement statement = connection.createStatement(); 
     ResultSet rs = statement.executeQuery(BIGQUERY_SESSIONID_QUERY)) {
    return rs.getString("session_id");
    ....

Environment

v 1.1.0 jdbc driver

Dependencies

using full shaded jar ('all' classifier)

Reproducer

Required: Provide a reproducer and the steps needed to reproduce this issue locally. If unable to provide a reproducer, please provide code snippets to help reproduce the issue. One of the two sections below MUST be filled out.

  1. A reproducer is the quickest method to resolve this issue. It could be a test case or a sample application. It is easier for us to troubleshoot the problem and to verify the solution.

Steps to reproduce:

Example

  1. Enable Speech API
  2. Upload a .mp4 file to GCS
  3. ...
  4. See {ERROR}

If unable to provide a reproducer, please provide a reason: ...

  1. Provide as many code snippets as possible:

Example

try (InstancesClient instancesClient = InstancesClient.create()) {
  ...
}

Logs and Stack Trace

Required: Provide logs that showcase the error. This will help show the flow of the application and help narrow down the cause. Additionally, provide a stack trace of the error if possible.

The Java SDK has a troubleshooting guide for enabling logs. This contains information regarding client-server communication, request and response details, and logging in dependency libraries. If using this guide, please obfuscate any private information (bearer tokens, request and response params, etc).

Additionally, please provide a stack trace of the error seen:

Example

TransportContext.java:347|Fatal (CERTIFICATE_UNKNOWN): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target (

"throwable" : {

sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

	at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:456)

	at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:323)

...

Behavior

Optional: Any additional information about the behavior of the error is helpful to debug.

Behavioral Questions:

  • When did the issue begin? Is this behavior related to any dependency version upgrade?
  • Is this behavior flaky? Or is this consistently seen in production?
  • Is this behavior related to the volume of data?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions