Skip to content

Optimize Connection.setReadOnly(false) in DataSourceUtils.resetConnectionAfterTransaction(…) #23747

@mp911de

Description

@mp911de

Currently, DataSourceUtils.resetConnectionAfterTransaction(…) queries the isReadOnly() state from the given JDBC Connection to disable read-only mode if isReadOnly() returns true. Ideally, the read-only state should be reset only if transaction attributes indicated to enable read-only mode (similar to isolation level and auto-commit).

Some JDBC drivers (e.g. H2) reach out to the database to query the state and we could skip this interaction.

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions