In that case you should use xa-datasource. If you use a pre AS7 version you will find several examples in the dox/example/jca folder
Thanks for the hints.
I am using xa-datasource + JPA
do I need datasource config file + JPA config file both?
Are there also configuration example for JPA part?
You need to define a datasource at server side and a configuration for the persistence in you application.
See jboss-eap-quickstarts/greeter/src/main/resources/META-INF/persistence.xml this file must reference the JNDI name of the datasource and being packed into the applicaiton.
Thanks for the hints
if I am using standalone jboss, where should be the location for data source file?
Is below example correct ?
It will be correct, but it is recommended to use the *ds.xml files in AS7 (or better) only for development.
If you use a productional environment you should add the datasource to the configuration to have the full support via management API.