Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 36 commits into from
Dec 27, 2024

Conversation

surbhigarg92
Copy link
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 as code owners 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
Copy link

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
18 checks passed
@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 join this conversation on GitHub. Already have an account? Sign in to comment
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