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.
The current example under transaction.rollback e.g.
will produce the following exception
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.