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

Open
wants to merge 34 commits into
base: main
Choose a base branch
from

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
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: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants