-
Notifications
You must be signed in to change notification settings - Fork 79
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
Try to determine if a datasource already does pooling #6199
Try to determine if a datasource already does pooling #6199
Conversation
Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured.
private static boolean isPooledDataSource(CommonDataSource dataSource) { | ||
return dataSource instanceof ConnectionPoolDataSource | ||
|| dataSource.getClass().getName().startsWith("org.apache.tomcat") | ||
; |
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.
At least we fix the Tomcat issues with this solution, which is the most important application server used by F!F in the wild.
Cosmetic minor remark: this can also be put at one line?
Also something like this can be added:
// Datasource from Tomcat is already doing pooling
or perhaps that's already obvious.
Or a Javadoc before the method: True if Tomcat connection pooling is used
Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured.
* Add Connection Pool Validation (#6119) (Cherrypick from 8a26d34) * PoolingJndiDataSourceFactory shouldn't check for DataSource to be XA or not XA (#6187) * Try to determine if a datasource already does pooling (#6199) Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured.
* Add Connection Pool Validation (#6119) (Cherrypick from 8a26d34) * PoolingJndiDataSourceFactory shouldn't check for DataSource to be XA or not XA (#6187) * Try to determine if a datasource already does pooling (#6199) Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured. (cherry picked from commit 281bf1e)
* Add Connection Pool Validation (#6119) (Cherrypick from 8a26d34) * PoolingJndiDataSourceFactory shouldn't check for DataSource to be XA or not XA (#6187) * Try to determine if a datasource already does pooling (#6199) Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured. (cherry picked from commit 281bf1e)
Only works for non-XA datasources currently, for XA datasources we need to still consider what is best to do as many XA drivers already implement pooling even if it's not configured.
I'm not sure about these changes, want to see if all works well in the Jenkins matrix builds. Am open to suggestions for better way to check.