1 of 1 people found this helpful
the Narayana JDBC driver is meant to be used for test development or for a small project. We do support it in upstream and do bug fixes but do not expect a full-featured pooling manager. If you run standalone Narayana in a "non-sandbox" project use DBCP2 (which is used for integration pooling library for Tomcat) or Agroal (as it's used as integration pooling library for Quarkus). You can check these two blogposts that could help to set up the libraries for your standalone project:
- Narayana team blog: Narayana integration with Agroal connection pool
- Narayana team blog: Narayana JDBC integration for Tomcat
Anyway, for not running away from your original question. What you mention seems really as a bug in the Narayana JDBC driver. Ideally, please create a jira at System Dashboard - JBoss Issue Tracker under JBTM project, the component is "Transactional Driver". Please, share there your reproducer!
And much more ideally. Narayana as open source project welcomes any contribution. If you've already checked the code, you have a reproducer and are able to fix the issue, please, create PR at GitHub - jbosstm/narayana: The codebase for the narayana project . We can then discuss the details there.
Hi Odrej, I am trying with agroal as you said... But I need to debug my tests because It seems to have a connection leak.
However, I am getting really strange metrics from Agroal...
Connections: 192 created | 0 invalid | 0 reap | 189 flush | 189 destroyed
Pool: 189 available | -186 active | 3 max | 583 acquired | 580 returned
Created duration: 001.380ms average | 188ms max | 264ms total
Acquire duration: 000.520ms average | 200ms max | 302ms total
Threads awaiting: 0
Why Agroal allows to have negative active connections (-186) ???
Why Agroal allows to have 189 available connections if 3 is the maximum value?
When It reaches the maximum of 3 connections.. it's ok, it waits for more connections, however, metrics are a little unusual
1 of 1 people found this helpful
Thank you Ondrej, I have solved the problem with "Agroal" adding a configuration based on "hibernate-agroal" (including transaction integration).
All the metrics are ok now, my problem with "agribal" was a bad integration / configuration that ends with the "close()" method called twice per transaction.
Here is the link to the test project that integrates Spring Data Jpa with CDI, Hibernate, Narayana and Agroal, supporting demarcation of transactions if anyone needs a sample.
arielcarrera I'm glad to hear it. I haven't got to investigate the Agroal metrics but I started to talk with Agroal engineer lbarreiro here if he can take a look. If this was an integration issue then probably no issue is needed.
Thank you for the link of your github project. It's great I can link in when talking with someone about integration.
I would point out that with the current version of Agroal in WildFly there is a critical issue with recovery: [WFLY-11214] Periodic recovery does not recover XAResource after jvm crash when agroal subsystem is used - JBoss Issue T…
Agree, the integration to WFLY has not been finished. But Agroal for standalone usage and e.g. in Quarkus is not affected by this WFLY integration issue.