Skip to content

fix(Spanner): ensure tag is passed to BeginTransactionRequest#8935

Merged
bshaffer merged 4 commits intomainfrom
transaction-tag-fix
Feb 27, 2026
Merged

fix(Spanner): ensure tag is passed to BeginTransactionRequest#8935
bshaffer merged 4 commits intomainfrom
transaction-tag-fix

Conversation

@bshaffer
Copy link
Copy Markdown
Contributor

@bshaffer bshaffer commented Feb 19, 2026

b/469259813

Ensure when a tag is set in the $options array for Database::runTransaction, that the tag is added to BeginTransactionRequest.

Example:

$options = ['tag' => $tagName];
$database->runTransaction(function (Transaction $transaction) use ($table) {
    // Create an insert mutation.
    $mutationData = [
        ['SingerId' => 35, 'FirstName' => 'Alice', 'LastName' => 'Smith'],
        ['SingerId' => 36, 'FirstName' => 'Bob', 'LastName' => 'Johnson'],
    ];

    foreach ($mutationData as $data) {
        $transaction->insert($table, $data);
        printf('Added insert mutation for SingerId: %s' . PHP_EOL, $data['SingerId']);
    }

    // Commit the transaction. 
    $commitTimestamp = $transaction->commit();
    printf('Committed transaction with tag: %s' . PHP_EOL, $commitTimestamp->formatAsString());
}, $options);

@bshaffer bshaffer requested a review from a team as a code owner February 19, 2026 22:34
@bshaffer bshaffer changed the title fix: ensure tag is passed to CommitRequest fix(Spanner): ensure tag is passed to CommitRequest Feb 19, 2026
@product-auto-label product-auto-label Bot added the api: spanner Issues related to the Spanner API. label Feb 20, 2026
@bshaffer bshaffer changed the title fix(Spanner): ensure tag is passed to CommitRequest fix(Spanner): ensure tag is passed to BeginTransactionRequest Feb 24, 2026
@bshaffer bshaffer added the next release PRs to be included in the next release label Feb 24, 2026
@bshaffer bshaffer merged commit 10ee79e into main Feb 27, 2026
35 of 37 checks passed
@bshaffer bshaffer deleted the transaction-tag-fix branch February 27, 2026 16:19
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 Spanner API. next release PRs to be included in the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants