2
0

Commit and Rollback take context

Remove Ex versions.
This commit is contained in:
Jack Christensen
2019-04-10 12:22:12 -05:00
parent 7718ee6207
commit 54c6ddc2f0
9 changed files with 32 additions and 45 deletions
+3 -3
View File
@@ -361,7 +361,7 @@ func benchmarkWriteNRowsViaInsert(b *testing.B, n int) {
}
}
err = tx.Commit()
err = tx.Commit(context.Background())
if err != nil {
b.Fatal(err)
}
@@ -392,7 +392,7 @@ func multiInsert(conn *pgx.Conn, tableName string, columnNames []string, rowSrc
if err != nil {
return 0, err
}
defer tx.Rollback()
defer tx.Rollback(context.Background())
for rowSrc.Next() {
if rowsThisInsert > 0 {
@@ -437,7 +437,7 @@ func multiInsert(conn *pgx.Conn, tableName string, columnNames []string, rowSrc
rowCount += rowsThisInsert
}
if err := tx.Commit(); err != nil {
if err := tx.Commit(context.Background()); err != nil {
return 0, nil
}