I just found that in GORM, the transaction commit might return error, like:

```
tx := db.begin()
// do somthing here
err := tx.Commit().Error

```

Also it appears when roll back

```
tx := db.begin()
// do somthing here
err := tx.Rollback().Error

```

I wonder how would this error happens?

And if happen, would GORM itself do any recover functions to deal with pending transactions?

Or is it necessary for me to do something if rollback or commit returns error?

BTW is there any best practice for such transaction issues in GORM?