Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 36 for Commit (0.21 sec)

  1. tests/transaction_test.go

    	user := User{Name: "transaction"}
    	if err := tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise")
    	}
    
    	if err := tx.Commit().Error; err != nil {
    		t.Fatalf("Commit should not raise error")
    	}
    
    	if err := tx.Rollback().Error; err == nil {
    		t.Fatalf("Rollback after commit should raise error")
    	}
    }
    
    func TestTransactionWithSavePoint(t *testing.T) {
    	tx := DB.Begin()
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  2. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  3. internal/disk/directio_unsupported.go

    // the semantics on filesystems like XFS, and these semantics are not
    // implemented at this time.
    // For more information on why typical DirectIO semantics do not apply to ZFS
    // see this ZFS-on-Linux commit message:
    // https://github.com/openzfs/zfs/commit/a584ef26053065f486d46a7335bea222cb03eeea
    
    // OpenFileDirectIO wrapper around os.OpenFile nothing special
    func OpenFileDirectIO(filePath string, flag int, perm os.FileMode) (*os.File, error) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Oct 18 18:08:15 GMT 2023
    - 2.6K bytes
    - Viewed (0)
  4. callbacks/callbacks.go

    	createCallback.Register("gorm:save_after_associations", SaveAfterAssociations(true))
    	createCallback.Register("gorm:after_create", AfterCreate)
    	createCallback.Match(enableTransaction).Register("gorm:commit_or_rollback_transaction", CommitOrRollbackTransaction)
    	createCallback.Clauses = config.CreateClauses
    
    	queryCallback := db.Callback().Query()
    	queryCallback.Register("gorm:query", Query)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  5. cni/pkg/plugin/plugin_dryrun_test.go

    			}
    		})
    	}
    }
    
    func getRules(b []byte) map[string]string {
    	// Separate content with "COMMIT"
    	parts := strings.Split(string(b), "COMMIT")
    	tables := make(map[string]string)
    	for _, table := range parts {
    		// If table is not empty, get table name from the first line
    		lines := strings.Split(strings.Trim(table, "\n"), "\n")
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Sat Feb 10 00:31:55 GMT 2024
    - 8.4K bytes
    - Viewed (0)
  6. 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 Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  7. buildscripts/gen-ldflags.go

    }
    
    // commitID returns the abbreviated commit-id hash of the last commit.
    func commitID() string {
    	// git log --format="%H" -n1
    	var (
    		commit []byte
    		err    error
    	)
    	cmdName := "git"
    	cmdArgs := []string{"log", "--format=%H", "-n1"}
    	if commit, err = exec.Command(cmdName, cmdArgs...).Output(); err != nil {
    		fmt.Fprintln(os.Stderr, "Error generating git commit-id: ", err)
    		os.Exit(1)
    	}
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jun 16 23:10:48 GMT 2022
    - 3.3K bytes
    - Viewed (0)
  8. cmd/build-constants.go

    	GOROOT = ""
    
    	// Version - version time.RFC3339.
    	Version = "DEVELOPMENT.GOGET"
    
    	// ReleaseTag - release tag in TAG.%Y-%m-%dT%H-%M-%SZ.
    	ReleaseTag = "DEVELOPMENT.GOGET"
    
    	// CommitID - latest commit id.
    	CommitID = "DEVELOPMENT.GOGET"
    
    	// ShortCommitID - first 12 characters from CommitID.
    	ShortCommitID = "DEVELOPMENT.GOGET"
    
    	// CopyrightYear - dynamic value of the copyright end year
    	CopyrightYear = "0000"
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 12 00:54:37 GMT 2024
    - 2.2K bytes
    - Viewed (0)
  9. interfaces.go

    }
    
    // ConnPoolBeginner conn pool beginner
    type ConnPoolBeginner interface {
    	BeginTx(ctx context.Context, opts *sql.TxOptions) (ConnPool, error)
    }
    
    // TxCommitter tx committer
    type TxCommitter interface {
    	Commit() error
    	Rollback() error
    }
    
    // Tx sql.Tx interface
    type Tx interface {
    	ConnPool
    	TxCommitter
    	StmtContext(ctx context.Context, stmt *sql.Stmt) *sql.Stmt
    }
    
    // Valuer gorm valuer interface
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Aug 19 13:33:31 GMT 2023
    - 2.2K bytes
    - Viewed (0)
  10. tests/connpool_test.go

    		t.Fatalf("No error should raise, but got %v", err)
    	}
    
    	if err = tx2.First(&User{}, "name = ?", "transaction-2").Error; err != nil {
    		t.Fatalf("Should find saved record, but got %v", err)
    	}
    
    	tx2.Commit()
    
    	if err = db.First(&User{}, "name = ?", "transaction-2").Error; err != nil {
    		t.Fatalf("Should be able to find committed record, but got %v", err)
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
Back to top