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

Fix for AutoCommit mode ... fixing change from #204 ... such that AutoCommitJdbcTransaction works as expected #392

Closed
rbygrave opened this issue Aug 20, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@rbygrave
Copy link
Member

So a bit of a story here but essentially the change in #204 (a revert of an earlier change) broke the support for using Ebean with connections using AutoCommit = true.

In Autocommit mode ... the AutoCommitJdbcTransaction should be used and that overrides the performCommit() and performRollback() methods. It however relies on the connection actually being in autocommit mode and the change in #204 broke that.

This fix pulls out the protected checkAutoCommit() method in JdbcTransaction and allows AutoCommitJdbcTransaction to override that to do nothing ... and hence leave the underlying connection in autocommit mode.

There is a test for this scenario but unfortunately the test was broken (at least it was a case of 2 wrongs getting the correct assert). The test is now more explicit and better asserts that autocommit is used and that commits happen automatically.

@rbygrave rbygrave added the bug label Aug 20, 2015
@rbygrave rbygrave self-assigned this Aug 20, 2015
@rbygrave rbygrave added this to the 6.3.2 milestone Aug 20, 2015
rbygrave added a commit that referenced this issue Aug 20, 2015
…hat AutoCommitJdbcTransaction works as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant