Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions fbconn/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,14 +156,11 @@ func (fbConn *FbConn) PrepareBatchStatement(ctx context.Context, sql string) (*S
if err != nil {
return nil, err
}
st, err := fbConn.prepareTx(ctx, tx, sql, statementScopeConnection)
rollback := prepareKeepTx
if startedTx {
err = operationerror.Join(err, fbConn.rollbackOwnedInternalTx(ctx, tx))
rollback = prepareRollbackAlways
}
if err != nil {
return nil, err
}
return st, nil
return fbConn.prepareTx(ctx, tx, sql, statementScopeConnection, rollback)
}

func (b *Batch) isClosed() bool {
Expand Down Expand Up @@ -391,7 +388,7 @@ func (b *Batch) Execute(ctx context.Context, tx *FBTransaction) (*BatchCompletio
err = operationerror.Join(errBatchExecutionFailed, normalizeTimeoutError(ctx, ctx.Err()))
}
if err != nil || completion.HasErrors() {
if rbErr := b.st.conn.rollbackOwnedInternalTx(ctx, execTx); rbErr != nil {
if rbErr := b.st.conn.rollbackOwnedInternalTx(ctx, execTx, false); rbErr != nil {
if err == nil {
err = errBatchExecutionFailed
}
Expand Down
Loading
Loading