Home | History | Annotate | Download | only in internal

Lines Matching refs:transaction

22 // RegisterTransactionSetter registers a function that sets transaction information
24 // the first being a protocol buffer type, and the second being *datastore.Transaction.
30 // applyTransaction applies the transaction t to message pb
32 func applyTransaction(pb proto.Message, t *pb.Transaction) {
39 var transactionKey = "used for *Transaction"
41 func transactionFromContext(ctx netcontext.Context) *transaction {
42 t, _ := ctx.Value(&transactionKey).(*transaction)
46 func withTransaction(ctx netcontext.Context, t *transaction) netcontext.Context {
50 type transaction struct {
51 transaction pb.Transaction
55 var ErrConcurrentTransaction = errors.New("internal: concurrent transaction")
62 // Begin the transaction.
63 t := &transaction{}
70 if err := Call(c, "datastore_v3", "BeginTransaction", req, &t.transaction); err != nil {
74 // Call f, rolling back the transaction if f returns a non-nil error, or panics.
83 Call(c, "datastore_v3", "Rollback", &t.transaction, &basepb.VoidProto{})
90 // Commit the transaction.
92 err := Call(c, "datastore_v3", "Commit", &t.transaction, res)