133
ctx context.Context,
134
row *sqlplugin.VisibilityRow,
136
>
defer func() {
137
>
retError = mdb.handle.ConvertError(retError)
138
>
}()
139
>
finalRow := mdb.prepareRowForDB(row)
140
>
db, err := mdb.handle.DB()
141
>
if err != nil {
142
return nil, err
143
}
145
>
if err != nil {
146
return nil, err
147
}
149
>
err := tx.Rollback()
150
>
// If the error is sql.ErrTxDone, it means the transaction already closed, so ignore error.
151
>
if err != nil && !errors.Is(err, sql.ErrTxDone) {
152
// Transaction rollback error should never happen, unless db connection was lost.
153
retError = fmt.Errorf("transaction rollback failed: %w", retError)
154
}
155
}()
156
>
result, err = tx.NamedExecContext(ctx, templateUpsertWorkflowExecution, finalRow)
visibility.go
157
>
if err != nil {
158
return nil, fmt.Errorf("unable to upsert workflow execution: %w", err)
159
}
160
>
_, err = tx.NamedExecContext(ctx, templateUpsertCustomSearchAttributes, finalRow)
visibility.go
161
>
if err != nil {
162
return nil, fmt.Errorf("unable to upsert custom search attributes: %w", err)
163
}
164
>
_, err = tx.NamedExecContext(ctx, templateUpsertChasmSearchAttributes, finalRow)
visibility.go
165
>
if err != nil {
166
return nil, fmt.Errorf("unable to upsert chasm search attributes: %w", err)
167
}
169
>
if err != nil {
170
return nil, err
171
}
173
}
174