Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for Stmts (0.03 sec)

  1. prepare_stmt.go

    func (db *PreparedStmtDB) Close() {
    	db.Mux.Lock()
    	defer db.Mux.Unlock()
    
    	for _, stmt := range db.Stmts {
    		go func(s *Stmt) {
    			// make sure the stmt must finish preparation first
    			<-s.prepared
    			if s.Stmt != nil {
    				_ = s.Close()
    			}
    		}(stmt)
    	}
    	// setting db.Stmts to nil to avoid further using
    	db.Stmts = nil
    }
    
    func (sdb *PreparedStmtDB) Reset() {
    	sdb.Mux.Lock()
    	defer sdb.Mux.Unlock()
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Aug 22 11:02:05 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  2. tests/prepared_stmt_test.go

    			var result User
    			tx.First(&result)
    			wg.Done()
    		}()
    	}
    	wg.Wait()
    
    	conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB)
    	AssertEqual(t, ok, true)
    	AssertEqual(t, len(conn.Stmts), 2)
    	for _, stmt := range conn.Stmts {
    		if stmt == nil {
    			t.Fatalf("stmt cannot bee nil")
    		}
    	}
    
    	AssertEqual(t, sqlDB.Stats().InUse, 0)
    }
    
    func TestPreparedStmtInTransaction(t *testing.T) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Aug 22 11:02:05 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  3. gorm.go

    				Tx:             t,
    				PreparedStmtDB: preparedStmt,
    			}
    		default:
    			tx.Statement.ConnPool = &PreparedStmtDB{
    				ConnPool: db.Config.ConnPool,
    				Mux:      preparedStmt.Mux,
    				Stmts:    preparedStmt.Stmts,
    			}
    		}
    		txConfig.ConnPool = tx.Statement.ConnPool
    		txConfig.PrepareStmt = true
    	}
    
    	if config.SkipHooks {
    		tx.Statement.SkipHooks = true
    	}
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Oct 09 11:29:48 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  4. api/go1.2.txt

    pkg testing, type CoverBlock struct, Col1 uint16
    pkg testing, type CoverBlock struct, Line0 uint32
    pkg testing, type CoverBlock struct, Line1 uint32
    pkg testing, type CoverBlock struct, Stmts uint16
    pkg testing, type TB interface, Error(...interface{})
    pkg testing, type TB interface, Errorf(string, ...interface{})
    pkg testing, type TB interface, Fail()
    pkg testing, type TB interface, FailNow()
    Registered: Tue Nov 05 11:13:11 UTC 2024
    - Last Modified: Fri Oct 18 04:36:59 UTC 2013
    - 1.9M bytes
    - Viewed (0)
Back to top