fix(11-08): document foreign and nested transaction refusal
- lagoon.Transaction doc and README state that a nested call over a root handle returns an error instead of opening an independent transaction - beachcomber README no longer promises an immediate sync inside a plain GORM transaction; it is warned and skipped since 11-08
This commit is contained in:
@@ -42,6 +42,9 @@ func (b *afterCommitBuffer) take() []func(context.Context, *gorm.DB) {
|
||||
// use the ctx and tx it receives. A Transaction nested in another becomes a
|
||||
// savepoint: its callbacks join the outer transaction's only when fn
|
||||
// succeeds, so work dropped with the savepoint never runs its callbacks.
|
||||
// A nested Transaction must receive the outer transaction's handle; given
|
||||
// a root handle it returns an error without running fn, rather than open
|
||||
// an independent transaction whose callbacks would wait on the outer one.
|
||||
// A panicking callback is logged and never turns a committed write into an
|
||||
// error.
|
||||
func Transaction(ctx context.Context, gdb *gorm.DB, fn func(ctx context.Context, tx *gorm.DB) error) error {
|
||||
|
||||
Reference in New Issue
Block a user