Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

chore: Improve error message for Read-only transaction with bounded staleness#2207

Merged
surbhigarg92 merged 36 commits intomainfrom
ro_boundedstaleness
Dec 27, 2024
Merged

chore: Improve error message for Read-only transaction with bounded staleness#2207
surbhigarg92 merged 36 commits intomainfrom
ro_boundedstaleness

Conversation

@surbhigarg92
Copy link
Copy Markdown
Contributor

@surbhigarg92 surbhigarg92 commented Dec 24, 2024

This PR will improve error message for Read Only transactions when maxStaleness or minReadTimestamp is passed.

database.getSnapshot({maxStaleness: 100}, async (err, transaction) => {
    if (err) {
      console.error(err); // 'maxStaleness / minReadTimestamp is not supported for multi-use read-only transactions.'
      return;
    }
    try {
      const [qOneRows] = await transaction.run('SELECT SingerId, AlbumId, AlbumTitle FROM Albums');
    } finally {
      transaction.end();
      // Close the database when finished.
      await database.close();
    }
  });

@surbhigarg92 surbhigarg92 requested review from a team December 24, 2024 10:51
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: spanner Issues related to the googleapis/nodejs-spanner API. labels Dec 24, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 24, 2024
@generated-files-bot
Copy link
Copy Markdown

Warning: This pull request is touching the following templated files:

  • .kokoro/common.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/docs-devsite.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/docs.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/docs.sh - .kokoro files are templated and should be updated in synthtool
  • .kokoro/release/publish.cfg - .kokoro files are templated and should be updated in synthtool
  • .kokoro/system-test.sh - .kokoro files are templated and should be updated in synthtool
  • .kokoro/test.bat - .kokoro files are templated and should be updated in synthtool
  • .kokoro/test.sh - .kokoro files are templated and should be updated in synthtool
  • .kokoro/trampoline_v2.sh - .kokoro files are templated and should be updated in synthtool
  • .github/workflows/ci.yaml - .github/workflows/ci.yaml (GitHub Actions) should be updated in synthtool

@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: m Pull request size is medium. labels Dec 24, 2024
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Dec 27, 2024
@surbhigarg92 surbhigarg92 merged commit 559031d into main Dec 27, 2024
@surbhigarg92 surbhigarg92 deleted the ro_boundedstaleness branch December 27, 2024 06:59
alkatrivedi pushed a commit that referenced this pull request Dec 27, 2024
…taleness (#2207)

* chore: integration test fix

* chore: Improve error message for Read-only transaction with bounded staleness

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* review comments

* review comments

* review comment

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: spanner Issues related to the googleapis/nodejs-spanner API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants