Our application currently uses a datasource which is defined in the JBoss standalone.xml, and basically we need to have this be defined within the app rather than in the con
Yes, you could use a JTA compliant transaction manager like Atomikos or Bitronix. Their respective sites have documentation on how to configure them with Spring. In general, you will have to follow the steps given below (if using Atomikos):
rtsDatasource
in your case) or create one if not already using (for example, if someone has a non-XA data source, that data source must be converted to an XA data source first).AtomikosDataSourceBean
.EntityManagerFactory
at the new AtomikosDataSourceBean
instance.JtaTransactionManager
.JtaTransactionManager
.A short configuration snippet using H2 database, Hibernate 4, Spring 4 and Atomikos 4 is shown below.
...
com.atomikos.icatch.jta.hibernate4.AtomikosPlatform
...
For details, you can see this app.