Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for txCtx (0.16 sec)

  1. tests/prepared_stmt_test.go

    	}
    
    	ctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)
    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    
    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	time.Sleep(time.Second)
    
    	var result2 User
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  2. src/database/sql/sql.go

    func (rs *Rows) initContextClose(ctx, txctx context.Context) {
    	if ctx.Done() == nil && (txctx == nil || txctx.Done() == nil) {
    		return
    	}
    	if bypassRowsAwaitDone {
    		return
    	}
    	closectx, cancel := context.WithCancel(ctx)
    	rs.cancel = cancel
    	go rs.awaitDone(ctx, txctx, closectx)
    }
    
    // awaitDone blocks until ctx, txctx, or closectx is canceled.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:16:53 UTC 2024
    - 103.6K bytes
    - Viewed (0)
Back to top