cockroachdb / cockroachdb/cockroach-go

should be able to `return tx.Commit()` from closure?

Open
#15 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
169
Forks
78
PR merge metrics
No merged PRs in 30d

Description

> sql: Transaction has already been committed or rolled back

``` go
if err := crdb.ExecuteTx(client.DB, func(tx *sql.Tx) error {
// do stuff

return tx.Commit() // works when returning `nil`
}); err != nil {
t.Fatalf("%+v", err)
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.