-
Notifications
You must be signed in to change notification settings - Fork 50
Add support for unpooled JDBC datasources #1780
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
base: 7.0.x
Are you sure you want to change the base?
Conversation
Co-authored-by: rrobetti <[email protected]>
Co-authored-by: rrobetti <[email protected]>
Co-authored-by: rrobetti <[email protected]>
- Add new jdbc-unpooled module to settings.gradle - Create UnpooledDataSource: simple DataSource using DriverManager - Create DatasourceConfiguration: configuration bean with calculated settings - Create DatasourceFactory: factory for creating unpooled datasources - Add comprehensive tests for unpooled connections - Add JSpecify dependency to jdbc and jdbc-unpooled modules - All tests pass (10/10) - Checkstyle and Spotless pass Co-authored-by: rrobetti <[email protected]>
- Create jdbc-unpooled.adoc with full documentation - Update toc.yml to include unpooled datasource section - Update jdbc.adoc to mention unpooled option - Update jdbc-connection-pools.adoc table to include unpooled - Documentation covers installation, configuration, use cases, performance considerations - Includes examples for migration between pooled and unpooled - Comprehensive warnings about performance implications Co-authored-by: rrobetti <[email protected]>
- Add database proxy (CNAM, pgpool, Open J Proxy) as first use case in package-info.java - Update warning text to mention externalized connection pooling - Remove production and microservices restrictions (valid with proxies) - Add note about performance considerations not applying with database proxies - Update jdbc.adoc warning to include database proxy use case - Delete ANALYSIS_README.md and IMPLEMENTATION_CHECKLIST.md files Co-authored-by: rrobetti <[email protected]>
Remove analysis document as requested - no longer needed in the PR. Co-authored-by: rrobetti <[email protected]>
…ction-pool Implement jdbc-unpooled module for unpooled database connections in Micronaut SQL
|
|
| @EachBean(DatasourceConfiguration.class) | ||
| @Requires(condition = JdbcDataSourceEnabled.class) | ||
| public DataSource dataSource(DatasourceConfiguration datasourceConfiguration) { | ||
| UnpooledDataSource ds = new UnpooledDataSource( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a delegating UnpooledDataSource? You should simply create a DataSource that is specified (maybe also add some builder option)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rationale for implementing unpolled datasource support is documented here #1779.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand, please describe the reason
|
Please sign CLA |
|
Maybe we can implement it without an extra dependency, simply by enable it with some property WDYT @radovanradic |
Maybe adding |
thanks for your comment, how would that look like? Can you provide more info? Should I change this implementation? |
I think what Denis suggested is there is no need for new module for this. Maybe you can just have UnpooledDatasourceFactory in jdbc module and then just create DataSource or as you named it UnpooledDataSource. And maybe there should be flag to tell whether datasource will be pooled to activate that factory, using condition similar to |
@dstepanov can you add your take on this? |
|
I don’t think we need a new module, maybe just an option like “allow-not-pulling-datasource=true” globally or per datasouce |
…rceConfiguration to jdbc module Co-authored-by: rrobetti <[email protected]>
…ed flag Co-authored-by: rrobetti <[email protected]>
…proach Co-authored-by: rrobetti <[email protected]>
Co-authored-by: rrobetti <[email protected]>
…urce Move unpooled datasource implementation to jdbc module with configuration flag
Implements Issue: #1779