what connection pool?
Sorry I didn't describe clearly.
I created an database datasource like following, then when I use jndi to connect to mysql database, the connection pool should be created by wildfly so everytime program calls getConnection, the connection is returned from pool. This is my understanding.
Is there any way to see how many live connections in the pool? I don't know how to look at jmx through Wildfly. or is there any other way to look at it.
<datasource jta="true" jndi-name="java:/mypool" pool-name="mypool" enabled="true" use-ccm="true">
<check-valid-connection-sql>select count(*) from dual</check-valid-connection-sql>
You can use the jboss-cli.bat (or .sh for Linux) tool .
This is in the "bin" folder.
The syntax will be something like
connect - You may need to enter servername/port/user/password depending on how your server is configured.
Once you are connected, the command to grab the connection information will be something like.
The part which tells you the number of live connections is listed as "Active Count".
Thanks a lot, I got it.
There is no way from Wildfly admin console to see this value, right? I'm thinking how to make it easier for system admin group to see the value.
you can see that same in the admin console as well.
just make sure you have statistics enabled for your datasource, by default they are not.
If you want to check the live connection is connection pool, please use jboss-cli else in admin console run time you can check.
Use below command and check the Active count
Note: This example for the datasource "ExampleDS"
when you say admin console, is it Wildfly administration console?
from command line I can get "activeCount", but from Wildfly administration console, going through configuration/subsystem/datasources/Non-XA/datasource name, from tab "pool", I can only see "min pool size", "max pool size", not sure which one means "activeCount".
I just feel GUI is easier for system admin to look for information. u
I got it. It is from runtime tab. Thanks so much.