code: func (repo Repo) Transaction(fn func(Repo) error) error {
  	adp, err := repo.adapter.Begin()
  	if err != nil {
  		return err
  	}
  
  	txRepo := New(adp)
  	txRepo.inTransaction = true
  
  	func() {
  		defer func() {
  			if p := recover(); p != nil {
  				txRepo.adapter.Rollback()
  
  				if e, ok := p.(errors.Error); ok && e.Kind() != errors.Unexpected {
  					err = e
  				} else {
  					panic(p) // re-throw panic after Rollback
  				}
  			} else if err != nil {
  				txRepo.adapter.Rollback()
  			} else {
  				err = txRepo.adapter.Commit()
  			}
  		}()
  
  		err = fn(txRepo)
  	}()
  
  	return err
  }
docs: // Transaction performs transaction with given function argument.