Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for commit2 (0.3 sec)

  1. tests/prepared_stmt_test.go

    	}
    
    	if err := tx.Create(&User{Name: "zzjin"}).Error; err != nil {
    		tx.Rollback()
    		t.Errorf("Failed to run one transaction, got error %v\n", err)
    	}
    
    	if err := tx.Commit().Error; err != nil {
    		t.Errorf("Failed to commit transaction, got error %v\n", err)
    	}
    
    	if result := db.Where("name=?", "zzjin").Delete(&User{}); result.Error != nil || result.RowsAffected != 1 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  2. errors.go

    import (
    	"errors"
    
    	"gorm.io/gorm/logger"
    )
    
    var (
    	// ErrRecordNotFound record not found error
    	ErrRecordNotFound = logger.ErrRecordNotFound
    	// ErrInvalidTransaction invalid transaction when you are trying to `Commit` or `Rollback`
    	ErrInvalidTransaction = errors.New("invalid transaction")
    	// ErrNotImplemented not implemented
    	ErrNotImplemented = errors.New("not implemented")
    	// ErrMissingWhereClause missing where clause
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 02:53:17 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  3. prepare_stmt.go

    	PreparedStmtDB *PreparedStmtDB
    }
    
    func (db *PreparedStmtTX) GetDBConn() (*sql.DB, error) {
    	return db.PreparedStmtDB.GetDBConn()
    }
    
    func (tx *PreparedStmtTX) Commit() error {
    	if tx.Tx != nil && !reflect.ValueOf(tx.Tx).IsNil() {
    		return tx.Tx.Commit()
    	}
    	return ErrInvalidTransaction
    }
    
    func (tx *PreparedStmtTX) Rollback() error {
    	if tx.Tx != nil && !reflect.ValueOf(tx.Tx).IsNil() {
    		return tx.Tx.Rollback()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
Back to top