RollbackReadWriteTransaction rollbacks read-write transaction.
(ctx context.Context)
| 164 | |
| 165 | // RollbackReadWriteTransaction rollbacks read-write transaction. |
| 166 | func (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. |
| 180 | func (s *Session) BeginReadOnlyTransaction(ctx context.Context, typ timestampBoundType, staleness time.Duration, timestamp time.Time, priority pb.RequestOptions_Priority, tag string) (time.Time, error) { |
no test coverage detected