Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for Transaction (0.17 sec)

  1. callbacks/transaction.go

    			db.Statement.ConnPool = tx.Statement.ConnPool
    			db.InstanceSet("gorm:started_transaction", true)
    		} else if tx.Error == gorm.ErrInvalidTransaction {
    			tx.Error = nil
    		} else {
    			db.Error = tx.Error
    		}
    	}
    }
    
    func CommitOrRollbackTransaction(db *gorm.DB) {
    	if !db.Config.SkipDefaultTransaction {
    		if _, ok := db.InstanceGet("gorm:started_transaction"); ok {
    			if db.Error != nil {
    				db.Rollback()
    			} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Nov 29 01:33:20 GMT 2021
    - 675 bytes
    - Viewed (0)
  2. tests/transaction_test.go

    		tx3 := DB.Session(&gorm.Session{PrepareStmt: true})
    		if err := tx3.Transaction(func(tx4 *gorm.DB) error {
    			// nested transaction
    			return tx4.Transaction(func(tx5 *gorm.DB) error {
    				return tx5.First(&User{}, "name = ?", "transaction-2").Error
    			})
    		}); err != nil {
    			t.Fatalf("prepare statement and nested transcation coexist" + err.Error())
    		}
    	})
    }
    
    func TestCancelTransaction(t *testing.T) {
    	ctx := context.Background()
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  3. callbacks/callbacks.go

    	deleteCallback.Register("gorm:before_delete", BeforeDelete)
    	deleteCallback.Register("gorm:delete_before_associations", DeleteBeforeAssociations)
    	deleteCallback.Register("gorm:delete", Delete(config))
    	deleteCallback.Register("gorm:after_delete", AfterDelete)
    	deleteCallback.Match(enableTransaction).Register("gorm:commit_or_rollback_transaction", CommitOrRollbackTransaction)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  4. tensorflow/c/experimental/filesystem/filesystem_interface.h

                                      TF_Status* status);
    
      /// Returns transaction token for `path` if it is part of a transaction else
      /// starts a new transaction and adds `path` to that transaction
      ///
      /// Transaction token is returned in `token`. Ownership of the token is in
      /// filesystem. Token will be freed in `end_transaction` call and any access
      /// to token after that is invalid.
      ///
    C
    - Registered: Tue Apr 30 12:39:09 GMT 2024
    - Last Modified: Fri May 27 17:36:54 GMT 2022
    - 53.1K bytes
    - Viewed (0)
  5. tests/connpool_test.go

    	}
    
    	tx := db.Begin()
    	user := *GetUser("transaction", Config{})
    
    	if err = tx.Save(&user).Error; err != nil {
    		t.Fatalf("No error should raise, but got %v", err)
    	}
    
    	if err = tx.First(&User{}, "name = ?", "transaction").Error; err != nil {
    		t.Fatalf("Should find saved record, but got %v", err)
    	}
    
    	user1 := *GetUser("transaction1-1", Config{})
    
    	if err = tx.Save(&user1).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Feb 06 02:54:40 GMT 2024
    - 5.5K bytes
    - Viewed (0)
  6. tests/prepared_stmt_test.go

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

    	defer conn.Close()
    	tx.Statement.ConnPool = conn
    	return fc(tx)
    }
    
    // Transaction start a transaction as a block, return error will rollback, otherwise to commit. Transaction executes an
    // arbitrary number of commands in fc within a transaction. On success the changes are committed; if an error occurs
    // they are rolled back.
    func (db *DB) Transaction(fc func(tx *DB) error, opts ...*sql.TxOptions) (err error) {
    	panicked := true
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  8. errors.go

    	"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)
  9. prepare_stmt.go

    	db.Mux.RLock()
    	if stmt, ok := db.Stmts[query]; ok && (!stmt.Transaction || isTransaction) {
    		db.Mux.RUnlock()
    		// wait for other goroutines prepared
    		<-stmt.prepared
    		if stmt.prepareErr != nil {
    			return Stmt{}, stmt.prepareErr
    		}
    
    		return *stmt, nil
    	}
    	db.Mux.RUnlock()
    
    	db.Mux.Lock()
    	// double check
    	if stmt, ok := db.Stmts[query]; ok && (!stmt.Transaction || isTransaction) {
    		db.Mux.Unlock()
    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)
  10. cmd/crossdomain-xml-handler.go

    // directed towards a domain other than its own, the remote domain needs to host a cross-domain
    // policy file that grants access to the source domain, allowing the client to continue the transaction.
    func setCrossDomainPolicyMiddleware(h http.Handler) http.Handler {
    	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		cxml := crossDomainXML
    		if globalServerCtxt.CrossDomainXML != "" {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Mar 18 06:42:40 GMT 2024
    - 2.2K bytes
    - Viewed (0)
Back to top