func (t *Transaction) Commit(ctx context.Context) error {
	if t.current == nil {
		return nil
	}
	t.mu.Lock()
	defer t.mu.Unlock()
	t.current.Commit()
	err := t.current.Error
	if err == nil {
		for i := range t.afterCommitHook {
			t.afterCommitHook[i](ctx)
		}
	}
	t.current = nil
	return err
}
// Commit finishes transaction by calling `*gorm.DB.Commit()`
// Reset current transaction and returns an error if any.
Commit finishes transaction by calling `*gorm.DB.Commit()`
Reset current transaction and returns an error if any.
// Commit finishes transaction by calling ` * gorm . DB . Commit () ` // Reset current transaction and returns an error if any .
func (t *Transaction) Commit(ctx context.Context) error {
	if t.current == nil {
		return nil
	}
	t.mu.Lock()
	defer t.mu.Unlock()
	t.current.Commit()
	err := t.current.Error
	if err == nil {
		for i := range t.afterCommitHook {
			t.afterCommitHook[i](ctx)
		}
	}
	t.current = nil
	return err
}
func ( t * Transaction ) Commit ( ctx context . Context ) error { if t . current == nil { return nil } t . mu . Lock ( ) defer t . mu . Unlock ( ) t . current . Commit ( ) err := t . current . Error if err == nil { for i := range t . afterCommitHook { t . afterCommitHook [ i ] ( ctx ) } } t . current = nil return err }
Commit finishes transaction by calling `*gorm.DB.Commit()`
Reset current transaction and returns an error if any.
Commit finishes transaction by calling ` * gorm . DB . Commit () ` Reset current transaction and returns an error if any .