Golang database/sql.Tx type example

package database/sql

Tx is an in-progress database transaction.

A transaction must end with a call to Commit or Rollback.

After a call to Commit or Rollback, all operations on the transaction fail with ErrTxDone.

Golang database/sql.Tx type usage example

 type Transaction struct {
 dbmap  *DbMap
 tx *sql.Tx
 closed bool
 }

Reference :

http://golang.org/pkg/database/sql/#Tx

Advertisement