- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for DefaultTransactionTimeout (0.17 sec)
-
finisher_api.go
opt *sql.TxOptions err error ) if len(opts) > 0 { opt = opts[0] } ctx := tx.Statement.Context if db.DefaultTransactionTimeout > 0 { if _, ok := ctx.Deadline(); !ok { ctx, _ = context.WithTimeout(ctx, db.DefaultTransactionTimeout) } } switch beginner := tx.Statement.ConnPool.(type) { case TxBeginner: tx.Statement.ConnPool, err = beginner.BeginTx(ctx, opt)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 22.9K bytes - Viewed (0) -
tests/transaction_test.go
}) }) if err != nil { t.Error(err) } } func TestTransactionWithDefaultTimeout(t *testing.T) { db, err := OpenTestConnection(&gorm.Config{DefaultTransactionTimeout: 2 * time.Second}) if err != nil { t.Fatalf("failed to connect database, got error %v", err) } tx := db.Begin() time.Sleep(3 * time.Second) if err = tx.Find(&User{}).Error; err == nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 13.3K bytes - Viewed (0) -
gorm.go
// GORM perform single create, update, delete operations in transactions by default to ensure database data integrity // You can disable it by setting `SkipDefaultTransaction` to true SkipDefaultTransaction bool DefaultTransactionTimeout time.Duration DefaultContextTimeout time.Duration // NamingStrategy tables, columns naming strategy NamingStrategy schema.Namer // FullSaveAssociations full save associations FullSaveAssociations bool
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 12.8K bytes - Viewed (0)