Repository navigation
datastore: Transaction sends non-transactional requests #204
Description
Activity
👍 it is a bit confusing at first. Maybe:
function ApiRequest() {} ApiRequest.prototype.delete ApiRequest.prototype.get ApiRequest.prototype.mapQuery ApiRequest.prototype.makeReq ApiRequest.prototype.runQuery ApiRequest.prototype.save function Transaction() {} Transaction.prototype.begin Transaction.prototype.commit Transaction.prototype.finalize Transaction.prototype.rollback function Dataset() {} util.extend(Dataset, ApiRequest);
We would just need to figure out how to get jsdoc to handle this.
Why not have Dataset just create an ApiRequest object and return that? We can use this to create requests for all the APIs in this library (much like is done in
google-api-nodejs-client. Transaction can just be designed to make transactional ApiRequests.Why not have Dataset just create an ApiRequest object and return that?
👍 assuming you mean Dataset methods (.get, .whatever) return ApiRequest objects.
Can you put together some rough code so I can better visualize how dataset/transaction would work with the new ApiRequest?
assuming you mean Dataset methods (.get, .whatever) return ApiRequest objects.
Yes.
Can you put together some rough code
Yes. I'll try and get a rough implementation out this weekend.
I don't like the fact that non-transactional calls are abstracted as method's of a pseudo transaction either. @ryanseys, could you propose an API with ApiRequest objects? I don't fully understand how it will look from the user's perspective.
Uhh, the API should not change as far as the user is concerned. More just refactoring. Separation of responsibility.
SGTM.
- changed the title
[-]Transaction sends non-transactional requests[/-][+]datastore: Transaction sends non-transactional requests[/+]on Oct 5, 2014 - addedapi: datastoreIssues related to the Datastore API.Issues related to the Datastore API.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
on Feb 2, 2015 52 remaining items
- added 2 commits that reference this issue
on Feb 24, 2026 - added 2 commits that reference this issue
on Feb 25, 2026 - added 2 commits that reference this issue
on Mar 5, 2026 - added 2 commits that reference this issue
on Mar 9, 2026 - added a commit that references this issue
on Mar 17, 2026 - added a commit that references this issue
on Mar 18, 2026
Confusing that a Transaction object can send non-transaction requests. It would be better if this logic was abstracted into something like a "APIRequest" or something.
Instead of instantiating Dataset with a transaction object, it should just be a API request creator object.
Maybe I'm being too picky.