Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 82 for rollback (0.58 sec)

  1. tests/prepared_stmt_test.go

    	tx := db.Begin()
    	defer func() {
    		if r := recover(); r != nil {
    			tx.Rollback()
    		}
    	}()
    	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)
    	}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. tests/connpool_test.go

    	}
    
    	if sqlTx, ok := tx.Statement.ConnPool.(gorm.TxCommitter); !ok || sqlTx == nil {
    		t.Fatalf("Should return the underlying sql.Tx")
    	}
    
    	tx.Rollback()
    
    	if err = db.First(&User{}, "name = ?", "transaction").Error; err == nil {
    		t.Fatalf("Should not find record after rollback, but got %v", err)
    	}
    
    	txDB := db.Where("fake_name = ?", "fake_name")
    	tx2 := txDB.Session(&gorm.Session{NewDB: true}).Begin()
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Feb 06 02:54:40 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  3. interfaces.go

    	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
    type Valuer interface {
    	GormValue(context.Context, *DB) clause.Expr
    }
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:33:31 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. callbacks/transaction.go

    		}
    	}
    }
    
    func CommitOrRollbackTransaction(db *gorm.DB) {
    	if !db.Config.SkipDefaultTransaction {
    		if _, ok := db.InstanceGet("gorm:started_transaction"); ok {
    			if db.Error != nil {
    				db.Rollback()
    			} else {
    				db.Commit()
    			}
    
    			db.Statement.ConnPool = db.ConnPool
    		}
    	}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Nov 29 01:33:20 UTC 2021
    - 675 bytes
    - Viewed (0)
  5. errors.go

    	"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
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Apr 26 02:53:17 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  6. prepare_stmt.go

    	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()
    	}
    	return ErrInvalidTransaction
    }
    
    func (tx *PreparedStmtTX) ExecContext(ctx context.Context, query string, args ...interface{}) (result sql.Result, err error) {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 28 08:47:39 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  7. guava/src/com/google/common/util/concurrent/AbstractCatchingFuture.java

      @CheckForNull @LazyInit Class<X> exceptionType;
      @CheckForNull @LazyInit F fallback;
    
      AbstractCatchingFuture(
          ListenableFuture<? extends V> inputFuture, Class<X> exceptionType, F fallback) {
        this.inputFuture = checkNotNull(inputFuture);
        this.exceptionType = checkNotNull(exceptionType);
        this.fallback = checkNotNull(fallback);
      }
    
      @Override
      public final void run() {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Feb 01 21:46:34 UTC 2024
    - 8.7K bytes
    - Viewed (0)
  8. android/guava-testlib/test/com/google/common/testing/TearDownStackTest.java

        boolean ran = false;
        @Nullable Callback callback = null;
    
        public SimpleTearDown() {}
    
        public SimpleTearDown(Callback callback) {
          this.callback = callback;
        }
    
        @Override
        public void tearDown() throws Exception {
          if (callback != null) {
            callback.run();
          }
          ran = true;
        }
      }
    
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Apr 17 15:19:38 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  9. android/guava-tests/test/com/google/common/util/concurrent/FutureCallbackTest.java

        MockCallback callback = new MockCallback("foo");
        addCallback(f, callback, directExecutor());
        f.set("foo");
      }
    
      public void testExecutorSuccess() {
        CountingSameThreadExecutor ex = new CountingSameThreadExecutor();
        SettableFuture<String> f = SettableFuture.create();
        MockCallback callback = new MockCallback("foo");
        Futures.addCallback(f, callback, ex);
        f.set("foo");
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Thu Apr 06 12:56:11 UTC 2023
    - 6.3K bytes
    - Viewed (0)
  10. callbacks.go

    		}
    	}
    	return nil
    }
    
    func (p *processor) Before(name string) *callback {
    	return &callback{before: name, processor: p}
    }
    
    func (p *processor) After(name string) *callback {
    	return &callback{after: name, processor: p}
    }
    
    func (p *processor) Match(fc func(*DB) bool) *callback {
    	return &callback{match: fc, processor: p}
    }
    
    func (p *processor) Register(name string, fn func(*DB)) error {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 26 03:33:36 UTC 2024
    - 8.6K bytes
    - Viewed (0)
Back to top