Rollback implements sql.TransactionSession.
(ctx *sql.Context, tx sql.Transaction)
| 130 | tx, err = sess.GetTxn(ctx, &stdsql.TxOptions{ReadOnly: tCharacteristic == sql.ReadOnly}) |
| 131 | if err != nil { |
| 132 | return nil, err |
| 133 | } |
| 134 | } |
| 135 | return &Transaction{*base.(*memory.Transaction), tx}, nil |
| 136 | } |
| 137 | |
| 138 | // CommitTransaction implements sql.TransactionSession. |
| 139 | func (sess *Session) CommitTransaction(ctx *sql.Context, tx sql.Transaction) error { |
| 140 | sess.GetLogger().Trace("CommitTransaction") |
| 141 | transaction := tx.(*Transaction) |
| 142 | if transaction.tx != nil { |
| 143 | sess.GetLogger().Trace("CommitDuckTransaction") |
| 144 | defer sess.CloseTxn() |
| 145 | if err := transaction.tx.Commit(); err != nil { |
| 146 | return err |