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

rollback example in current docs throws exception #621

Closed
abelino opened this issue May 22, 2015 · 4 comments
Closed

rollback example in current docs throws exception #621

abelino opened this issue May 22, 2015 · 4 comments
Assignees
Labels
api: datastore Issues related to the Datastore API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: question Request for information or clarification. Not an issue.

Comments

@abelino
Copy link

abelino commented May 22, 2015

The current example under transaction.rollback e.g.

transaction.begin(function(err) {
  transaction.rollback(function(err) {
    if (err) {
      // Transaction could not be rolled back.
    }
  });
});

will produce the following exception

Error: Missing at least one required field for Message .pb.RollbackRequest: .pb.RollbackRequest.transaction
    at Error (<anonymous>)
    at ProtoBuf.Reflect.MessagePrototype.encode (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:2345:31)
    at MessagePrototype.encode (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:1981:31)
    at MessagePrototype.encodeNB (/app/node_modules/gcloud/node_modules/protobufjs/dist/ProtoBuf.js:2063:41)
    at Transaction.DatastoreRequest.makeReq_ (/app/node_modules/gcloud/lib/datastore/request.js:599:51)
    at Transaction.rollback (/app/node_modules/gcloud/lib/datastore/transaction.js:135:8)
    at Object.queryCb (/app/route-callbacks.js:558:19)
    at /app/node_modules/gcloud/lib/datastore/request.js:459:9
    at /app/node_modules/gcloud/lib/datastore/request.js:640:13
    at Object.handleResp (/app/node_modules/gcloud/lib/common/util.js:193:3)

Is that still the proper way to rollback? or should we simply call done()... when should rollback be actually used? after a commit and if the commit returns an error?

Thanks for any advice.

@jgeewax jgeewax added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: question Request for information or clarification. Not an issue. api: datastore Issues related to the Datastore API. labels May 22, 2015
@jgeewax jgeewax added this to the Datastore Stable milestone May 22, 2015
@stephenplusplus
Copy link
Contributor

Yes, I believe a rollback should only be done after a commit. This example definitely needs to be changed. I've thrown together a PR that will hopefully clear this up: #622

@stephenplusplus
Copy link
Contributor

We've fixed this in our docs by showing better how to use Transactions.

@abelino
Copy link
Author

abelino commented Jun 10, 2015

Thanks for the support

@stephenplusplus
Copy link
Contributor

Thanks for catching our mistakes!

sofisl pushed a commit that referenced this issue Oct 11, 2022
chore: relocate owl bot post processor
sofisl pushed a commit that referenced this issue Oct 13, 2022
chore: relocate owl bot post processor
sofisl pushed a commit that referenced this issue Nov 10, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/3ab4095b-0974-4516-aab6-99038956a6bc/targets

- [ ] To automatically regenerate this PR, check this box.
sofisl pushed a commit that referenced this issue Nov 10, 2022
* chore(main): release 4.0.2

* 🦉 Updates from OwlBot post-processor

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

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
#621)

* changes without context

        autosynth cannot find the source of changes triggered by earlier changes in this
        repository, or by version upgrades to tools such as linters.

* feat!: additional client library annotations feat: reload information in the Document resource BREAKING CHANGE: additional long-running operation annotations BREAKING CHANGE: some existing request fields are now explicitly required BREAKING CHANGE: the order of the Session resource patterns has changed

PiperOrigin-RevId: 312345206

Source-Author: Google APIs <noreply@google.com>
Source-Date: Tue May 19 13:46:01 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 7a8875d4bcf51993f6f7aa181066cc5ec95539d5
Source-Link: googleapis/googleapis@7a8875d

* feat: add one additional binding for SearchAgents API; clean up deps; update Go library. docs: update doc links for intent.

PiperOrigin-RevId: 313408465

Source-Author: Google APIs <noreply@google.com>
Source-Date: Wed May 27 09:53:46 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 576234f179d2e8dde1e629888afafb59abec7e6c
Source-Link: googleapis/googleapis@576234f

* docs: cleaned docs for the Agents service and resource.

PiperOrigin-RevId: 314879617

Source-Author: Google APIs <noreply@google.com>
Source-Date: Fri Jun 5 00:27:22 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: cd804bab06e46dd1a4f16c32155fd3cddb931b52
Source-Link: googleapis/googleapis@cd804ba

* fix(tests): avoid Node v10 memory issue when running tests

Co-authored-by: Alexander Fenster <fenster@google.com>
sofisl pushed a commit that referenced this issue Sep 13, 2023
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [linkinator](https://github.com/JustinBeckwith/linkinator) | [`^2.0.3` -> `^4.0.0`](https://renovatebot.com/diffs/npm/linkinator/2.16.2/4.0.0) | [![age](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/compatibility-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/linkinator/4.0.0/confidence-slim/2.16.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>JustinBeckwith/linkinator</summary>

### [`v4.0.0`](https://github.com/JustinBeckwith/linkinator/releases/tag/v4.0.0)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.1.0...v4.0.0)

##### Features

-   create new release with notes ([#&#8203;508](https://github.com/JustinBeckwith/linkinator/issues/508)) ([2cab633](https://github.com/JustinBeckwith/linkinator/commit/2cab633c9659eb10794a4bac06f8b0acdc3e2c0c))

##### BREAKING CHANGES

-   The commits in [#&#8203;507](https://github.com/JustinBeckwith/linkinator/issues/507) and [#&#8203;506](https://github.com/JustinBeckwith/linkinator/issues/506) both had breaking changes.  They included dropping support for Node.js 12.x and updating the CSV export to be streaming, and to use a new way of writing the CSV file.  This is an empty to commit using the `BREAKING CHANGE` format in the commit message to ensure a release is triggered.

### [`v3.1.0`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.1.0)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.6...v3.1.0)

##### Features

-   allow --skip to be defined multiple times ([#&#8203;399](https://github.com/JustinBeckwith/linkinator/issues/399)) ([5ca5a46](https://github.com/JustinBeckwith/linkinator/commit/5ca5a461508e688de12e5ae6b4cfb6565f832ebf))

### [`v3.0.6`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.6)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.5...v3.0.6)

##### Bug Fixes

-   **deps:** upgrade node-glob to v8 ([#&#8203;397](https://github.com/JustinBeckwith/linkinator/issues/397)) ([d334dc6](https://github.com/JustinBeckwith/linkinator/commit/d334dc6734cd7c2b73d7ed3dea0550a6c3072ad5))

### [`v3.0.5`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.5)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.4...v3.0.5)

##### Bug Fixes

-   **deps:** upgrade to htmlparser2 v8.0.1 ([#&#8203;396](https://github.com/JustinBeckwith/linkinator/issues/396)) ([ba3b9a8](https://github.com/JustinBeckwith/linkinator/commit/ba3b9a8a9b19d39af6ed91790135e833b80c1eb6))

### [`v3.0.4`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.4)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.3...v3.0.4)

##### Bug Fixes

-   **deps:** update dependency gaxios to v5 ([#&#8203;391](https://github.com/JustinBeckwith/linkinator/issues/391)) ([48af50e](https://github.com/JustinBeckwith/linkinator/commit/48af50e787731204aeb7eff41325c62291311e45))

### [`v3.0.3`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.3)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.2...v3.0.3)

##### Bug Fixes

-   export getConfig from index ([#&#8203;371](https://github.com/JustinBeckwith/linkinator/issues/371)) ([0bc0355](https://github.com/JustinBeckwith/linkinator/commit/0bc0355c7e2ea457f247e6b52d1577b8c4ecb3a1))

### [`v3.0.2`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.2)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.1...v3.0.2)

##### Bug Fixes

-   allow server root with trailing slash ([#&#8203;370](https://github.com/JustinBeckwith/linkinator/issues/370)) ([8adf6b0](https://github.com/JustinBeckwith/linkinator/commit/8adf6b025fda250e38461f1cdad40fe08c3b3b7c))

### [`v3.0.1`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.1)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v3.0.0...v3.0.1)

##### Bug Fixes

-   decode path parts in local web server ([#&#8203;369](https://github.com/JustinBeckwith/linkinator/issues/369)) ([4696a0c](https://github.com/JustinBeckwith/linkinator/commit/4696a0c38c341b178ed815f47371fca955979feb))

### [`v3.0.0`](https://github.com/JustinBeckwith/linkinator/releases/tag/v3.0.0)

[Compare Source](https://github.com/JustinBeckwith/linkinator/compare/v2.16.2...v3.0.0)

##### Bug Fixes

-   **deps:** update dependency chalk to v5 ([#&#8203;362](https://github.com/JustinBeckwith/linkinator/issues/362)) ([4b17a8d](https://github.com/JustinBeckwith/linkinator/commit/4b17a8d87b649eaf813428f8ee6955e1d21dae4f))

-   feat!: convert to es modules, drop node 10 ([#&#8203;359](https://github.com/JustinBeckwith/linkinator/issues/359)) ([efee299](https://github.com/JustinBeckwith/linkinator/commit/efee299ab8a805accef751eecf8538915a4e7783)), closes [#&#8203;359](https://github.com/JustinBeckwith/linkinator/issues/359)

##### BREAKING CHANGES

-   this module now requires node.js 12 and above, and has moved to es modules by default.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-automl).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants