MCPcopy Index your code
hub / github.com/cloudspannerecosystem/spanner-cli / RollbackReadWriteTransaction

Method RollbackReadWriteTransaction

session.go:166–177  ·  view source on GitHub ↗

RollbackReadWriteTransaction rollbacks read-write transaction.

(ctx context.Context)

Source from the content-addressed store, hash-verified

164
165// RollbackReadWriteTransaction rollbacks read-write transaction.
166func (s *Session) RollbackReadWriteTransaction(ctx context.Context) error {
167 if !s.InReadWriteTransaction() {
168 return errors.New("read-write transaction is not running")
169 }
170
171 s.tcMutex.Lock()
172 defer s.tcMutex.Unlock()
173
174 s.tc.rwTxn.Rollback(ctx)
175 s.tc = nil
176 return nil
177}
178
179// BeginReadOnlyTransaction starts read-only transaction and returns the snapshot timestamp for the transaction if successful.
180func (s *Session) BeginReadOnlyTransaction(ctx context.Context, typ timestampBoundType, staleness time.Duration, timestamp time.Time, priority pb.RequestOptions_Priority, tag string) (time.Time, error) {

Callers 1

ExecuteMethod · 0.80

Calls 1

Tested by

no test coverage detected