Commit and rollbase need not check for failure state

issue421
Jack Christensen 2018-05-12 19:59:12 -05:00
parent f114ec85a1
commit f42b0f65fc
1 changed files with 2 additions and 2 deletions

4
tx.go
View File

@ -117,7 +117,7 @@ func (tx *Tx) Commit() error {
// CommitEx commits the transaction with a context.
func (tx *Tx) CommitEx(ctx context.Context) error {
if !(tx.Status() == TxStatusInProgress || tx.Status() == TxStatusInFailure) {
if tx.status != TxStatusInProgress {
return ErrTxClosed
}
@ -152,7 +152,7 @@ func (tx *Tx) Rollback() error {
// RollbackEx is the context version of Rollback
func (tx *Tx) RollbackEx(ctx context.Context) error {
if !(tx.Status() == TxStatusInProgress || tx.Status() == TxStatusInFailure) {
if tx.status != TxStatusInProgress {
return ErrTxClosed
}