Skip to content

feat: deny only open CommitTx flag for non-interactive transactions #1737

Open
@rekby

Description

@rekby

Feature Request

Describe the Feature Request

Prevent use only open flag for controlTx for methods with guarantee non-interactive transactions.

This code is cause of transaction-leak and bad_session errors (sesstion close when starts many non-closed transaction).

// Example of code with transaction leak
client.DB.Query().QueryResultSet(ctx,
		sql,
		query.WithParameters(params),
		query.WithTxControl(query.SnapshotReadOnlyTxControl()),
		query.WithIdempotent(),
	)

Describe Preferred Solution

Deny only open controlTx (and return error) AutoAdd CommitTx() option.

I prefer check flag and return error with describe cause and solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions