Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tbg opened this issue Jul 20, 2016 · 2 comments
Open

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

tbg opened this issue Jul 20, 2016 · 2 comments

Comments

@tbg
Copy link
Member

tbg commented Jul 20, 2016

sql: Transaction has already been committed or rolled back

        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)
        }
@tamird
Copy link
Contributor

tamird commented Apr 25, 2017

Looks like a wontfix?

// opportunity to react to retryable errors, whereas tx.Commit() doesn't.

justinj pushed a commit to justinj/cockroach-go that referenced this issue May 16, 2017
Add `dockergitclean` target to Makefile
@andreimatei
Copy link
Contributor

Yeah... What's the suggestion here, Tobi? Even without the fact that you can't react to a retryable error after you attempt a commit, how would ExecuteTx() know if it's supposed to attempt to commit or if the closure did it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants