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

Auto-configure jOOQ to use an ExecutorProvider bean if available #14471

Closed

Conversation

davinkevin
Copy link
Contributor

@davinkevin davinkevin commented Sep 14, 2018

This improvement allow to define a custom Executor for Jooq. To provide it, you have to wrap it under a org.jooq.ExecutorProvider. This is useful in multiple case, especially for testing in my case when I want to run my @Sql() test inside a transaction with fetchAsync which wasn't compatible. Thanks to this, we can in our test use the SyncTaskExecutor to use the main thread for all our tests.

BTW, I've made some code modification in another commit (not in this PR) to simplify (from my point of view) the configuration system (using the ObjectProvider instead of relying on null). Do you think I can make a PR of this (davinkevin@bf4e36c) ?

This improvement allow to define a custom Executor for Jooq. To provide it, you have to wrap it under a org.jooq.ExecutorProvider. This is useful in multiple case, especially for testing in my case when I want to run my @Sql() test inside a transaction with `fetchAsync` which wasn't compatible. Thanks to this, we can in our test use the SyncTaskExecutor to use the `main` thread for all our tests.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 14, 2018
@wilkinsona wilkinsona changed the title feat(jooq): support auto-configuration of executor if provided as bean Auto-configure jOOQ to use an ExecutorProvider bean if available Sep 14, 2018
@wilkinsona wilkinsona added the type: enhancement A general enhancement label Sep 14, 2018
@philwebb philwebb removed the status: waiting-for-triage An issue we've not yet triaged label Sep 14, 2018
@philwebb philwebb added this to the 2.1.x milestone Sep 14, 2018
@philwebb
Copy link
Member

Thanks for the PR. I'm not totally sold on davinkevin@bf4e36c, I wonder if using PropertyMapper might be better.

@wilkinsona wilkinsona self-assigned this Sep 17, 2018
wilkinsona added a commit that referenced this pull request Sep 17, 2018
* gh-14471:
  Polish "Use ExecutorProvider bean if available when auto-configuring jOOQ"
  Use ExecutorProvider bean if available when auto-configuring jOOQ
@wilkinsona
Copy link
Member

@davinkevin Thank you very much for your contribution. The proposed changes have now been merged into master. I also applied a small polishing commit, the main part of which was a small update to the documentation.

@wilkinsona wilkinsona modified the milestones: 2.1.x, 2.1.0.M4 Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants