-
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
Add Connection Pool Validation #6119
Conversation
…tions, and connection validation.
I am not sure if adding a |
maxIdleTime is not available in all pool implementations. It seems to be only available when using BTM's own pool. For non-XA connections we always use DBCP2's pool, and for Narayana we also always use DBCP2's pool implementation (for either XA or non-XA connections). So it seemed to make sense to me, to add a setting for BTW I made this PR when on a call with Jeroen & Ali to discuss an issue they are having with database connections in one of the systems. I'm not sure if this PR will even help them. When you are back, we might decide you finish the changes since you are already working on similar sets of changes. |
Yes, I wasn't aware of the fact that only BTM understands that If maxPoolSize = 20, and minPoolSize = 0, I'd consider a |
Some more settings should be added I think, for validation of connections while idle and also, importantly, for the time in between idle connection checking. Otherwise there's no regular validation of idle connections and if my understanding is correct, also not a cleanup of idle connections at regular intervals. Those settings are only for DBCP2, not for BTM, but still needed in the BTM configuration properties for non-XA connections pools. |
We're already setting |
…stead of letting Tomcat use a generic one.
…_JdbcConnPoolSettings
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.
Ik denk dat je nog wel JJ's wijzigingen moet mergen?
if (dataSource instanceof XADataSource) { | ||
return createXAPool((XADataSource) dataSource, dataSourceName); | ||
} |
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.
Deze moet ook in de maxPoolSize if check?
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.
Ik hernoem de method naar createXADataSource()
om verwarring te voorkomen. Bij BTM wordt al altijd een pool gecreerd voor XA sessions, ongeacht maxPoolSize. Die zet daarin ook een aantal andere properties, die niet direct gerelateerd zijn aan pooling, dus ik durf daar niet teveel aan te veranderen.
Met een andere naam van de method is het hopelijk minder verwarrend.
return createXAPool((XADataSource) dataSource, dataSourceName); | ||
} | ||
|
||
log.info("DataSource [{}] is not XA enabled, unable to register with an Transaction Manager", dataSourceName); |
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.
Deze log klopt niet helemaal meer 😃
core/src/main/java/nl/nn/adapterframework/jndi/JndiDataSourceFactory.java
Outdated
Show resolved
Hide resolved
Klopt maar dan moeten die eerst naar 7.9 gebackport en gemerged worden. |
…actory.java Co-authored-by: Niels Meijer <nielsmeijer@hotmail.com>
Nu helaas conflicten 😞 |
Dat wisten we, dat dat ging gebeuren. Ik heb gisteren niet meer gekeken naar de mail of je nog dingen had gemerged, sorry. |
# Conflicts: # core/src/main/java/nl/nn/adapterframework/jta/btm/BtmDataSourceFactory.java # core/src/main/java/nl/nn/adapterframework/jta/narayana/NarayanaDataSourceFactory.java
|
||
@Override | ||
public String toString() { | ||
return "ManagedDataSource [], DBCP2 Pool Info: " + super.getPool(); |
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.
Waarom de []
?
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.
Ik had er iets over de datasource tussen will zetten en toen bleek dat toch niet nodig.
…erfere with application servers which do their own pooling and transaction management.
* 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)
Add some configuration properties for connection pool max-idle connections, and connection validation.