code: @Override
    public ICloudSpannerConnection getConnection() throws SQLException {
      if (logger.logDebug()) {
        debug("CloudSpannerXAConnection.getConnection called");
      }
  
      Connection connection = super.getConnection();
  
      // When we're outside an XA transaction, autocommit
      // is supposed to be true, per usual JDBC convention.
      // When an XA transaction is in progress, it should be
      // false.
      if (state == STATE_IDLE) {
        connection.setAutoCommit(true);
      }
  
      /*
       * Wrap the connection in a proxy to forbid application from fiddling with transaction state
       * directly during an XA transaction
       */
      ConnectionHandler handler = new ConnectionHandler(connection);
      return (ICloudSpannerConnection) Proxy.newProxyInstance(getClass().getClassLoader(),
          new Class[] {Connection.class, ICloudSpannerConnection.class}, handler);
    }
docs: **
  XAConnection interface
  **