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

Try to determine if a datasource already does pooling #6199

Merged

Conversation

tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented Jan 31, 2024

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.

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.
@tnleeuw tnleeuw self-assigned this Jan 31, 2024
@tnleeuw tnleeuw added the 7.9 label Jan 31, 2024
@tnleeuw tnleeuw linked an issue Jan 31, 2024 that may be closed by this pull request
private static boolean isPooledDataSource(CommonDataSource dataSource) {
return dataSource instanceof ConnectionPoolDataSource
|| dataSource.getClass().getName().startsWith("org.apache.tomcat")
;
Copy link
Contributor

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

@nielsm5 nielsm5 merged commit 295c57f into 7.9-release Feb 1, 2024
10 of 11 checks passed
@nielsm5 nielsm5 deleted the issue/7.9/6117_AvoidCreatingPoolAroundPoolingDataSource branch February 1, 2024 17:09
tnleeuw added a commit that referenced this pull request Feb 1, 2024
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.
nielsm5 pushed a commit that referenced this pull request Feb 5, 2024
* 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.
tnleeuw added a commit that referenced this pull request Feb 5, 2024
* 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)
nielsm5 pushed a commit that referenced this pull request Feb 5, 2024
* 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Db connections are left open in pool
3 participants