Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check datasource in JBoss?

Tags:

java

jboss

jmx

I have a datasource, how to check if its ok? maybe somehow using jmx-console?

like image 471
IAdapter Avatar asked Mar 06 '11 17:03

IAdapter


3 Answers

If you want just check if data source is installed and some statistic information about it you can read that bean: jboss.jca:name=DefaultDS,service=ManagedConnectionPool.

You can find such bean for each data source, just change DefaultDS with the data source name.

like image 113
Lukasz Stelmach Avatar answered Sep 21 '22 15:09

Lukasz Stelmach


With JBoss 7, you can use the jboss-admin command line tool to test the datasource. Run this line in jboss-admin (after adjusting the JNDI name of the datasource, and example assuming that it is an XA datasource):

/subsystem=datasources/xa-data-source=java\:jboss/datasources/XAOracleDS:test-connection-in-pool

More details can be found here: http://www.javalinux.it/wordpress/2011/07/14/how-to-create-an-manage-datasources-in-as7/

like image 35
Jan Avatar answered Sep 17 '22 15:09

Jan


The above did not work for me, but this worked-

Run this line in jboss-cli:

/subsystem=datasources/xa-data-source=jdbc\/XAOracleDS:test-connection-in-pool

like image 44
Denis Bredelet Avatar answered Sep 18 '22 15:09

Denis Bredelet