Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new property skipSetAutoCommitOnClose to JdbcTransactionFactory #2516

Conversation

harawata
Copy link
Member

Sample configuration:

<transactionManager type="JDBC">
  <property name="skipSetAutoCommitOnClose" value="true"/>
</transactionManager>
  • Enabling this switch skips setAutoCommit(true) call when closing the transaction.
  • Enabling this switch may improve performance with some drivers (e.g. mysql-connector-java, mssql-jdbc), but not others (e.g. Oracle).
  • Enabling this switch may cause exception with some drivers (e.g. Derby).

Should fix #2426

TODO: docs

Sample configuration:

```xml
<transactionManager type="JDBC">
  <property name="skipSetAutoCommitOnClose" value="true"/>
</transactionManager>
```

- Enabling this switch skips `setAutoCommit(true)` call when closing the transaction.
- Enabling this switch may improve performance with some drivers (e.g. mysql-connector-java, mssql-jdbc), but not others (e.g. Oracle).
- Enabling this switch may cause exception with some drivers (e.g. Derby).

Should fix mybatis#2426

TODO: docs
@coveralls
Copy link

coveralls commented Apr 10, 2022

Coverage Status

Coverage increased (+0.05%) to 87.266% when pulling ccf52ab on harawata:add-skipSetAutoCommitOnClose-to-JdbcTransactionFactory into 0f42365 on mybatis:master.

dependabot bot and others added 12 commits April 23, 2022 03:54
Bumps [h2](https://github.com/h2database/h2database) from 2.1.210 to 2.1.212.
- [Release notes](https://github.com/h2database/h2database/releases)
- [Commits](h2database/h2database@version-2.1.210...version-2.1.212)

---
updated-dependencies:
- dependency-name: com.h2database:h2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [junit-jupiter](https://github.com/testcontainers/testcontainers-java) from 1.16.3 to 1.17.0.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.16.3...1.17.0)

---
updated-dependencies:
- dependency-name: org.testcontainers:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [mysql](https://github.com/testcontainers/testcontainers-java) from 1.16.3 to 1.17.0.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.16.3...1.17.0)

---
updated-dependencies:
- dependency-name: org.testcontainers:mysql
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [postgresql](https://github.com/testcontainers/testcontainers-java) from 1.16.3 to 1.17.0.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.16.3...1.17.0)

---
updated-dependencies:
- dependency-name: org.testcontainers:postgresql
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [postgresql](https://github.com/testcontainers/testcontainers-java) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.17.0...1.17.1)

---
updated-dependencies:
- dependency-name: org.testcontainers:postgresql
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [junit-jupiter](https://github.com/testcontainers/testcontainers-java) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.17.0...1.17.1)

---
updated-dependencies:
- dependency-name: org.testcontainers:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [mysql](https://github.com/testcontainers/testcontainers-java) from 1.17.0 to 1.17.1.
- [Release notes](https://github.com/testcontainers/testcontainers-java/releases)
- [Changelog](https://github.com/testcontainers/testcontainers-java/blob/master/CHANGELOG.md)
- [Commits](testcontainers/testcontainers-java@1.17.0...1.17.1)

---
updated-dependencies:
- dependency-name: org.testcontainers:mysql
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Bumps [postgresql](https://github.com/pgjdbc/pgjdbc) from 42.3.3 to 42.3.4.
- [Release notes](https://github.com/pgjdbc/pgjdbc/releases)
- [Changelog](https://github.com/pgjdbc/pgjdbc/blob/master/CHANGELOG.md)
- [Commits](pgjdbc/pgjdbc@REL42.3.3...REL42.3.4)

---
updated-dependencies:
- dependency-name: org.postgresql:postgresql
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
@harawata harawata marked this pull request as ready for review April 23, 2022 18:25
@harawata harawata force-pushed the add-skipSetAutoCommitOnClose-to-JdbcTransactionFactory branch from 065a110 to ccf52ab Compare April 23, 2022 21:55
@harawata harawata merged commit 13d5d0d into mybatis:master Apr 24, 2022
@harawata harawata deleted the add-skipSetAutoCommitOnClose-to-JdbcTransactionFactory branch April 24, 2022 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow skipping setAutoCommit() call in JdbcTransaction
2 participants