...
| Info | ||
|---|---|---|
| ||
Since the datasources are created via the BTM API (ie: not with |
Step
...
3: Configure JMS connection factory beans
The next things you will need to configure are the JMS connection factories.
...
| Info | ||
|---|---|---|
| ||
Since the connection factories are created via the BTM API (ie: not with |
Step
...
4: Configure BTM beans
The next thing you need to do is configure beans for BTM.
| Code Block | ||
|---|---|---|
| ||
<!-- Bitronix Transaction Manager embedded configuration --> <bean id="btmConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices"> <property name="serverId" value="spring-btm" /> </bean> <!-- create BTM transaction manager --> <bean id="BitronixTransactionManager" factory-method="getTransactionManager" class="bitronix.tm.TransactionManagerServices" depends-on="btmConfig" destroy-method="shutdown" /> |
Step
...
5: Configure Spring PlatformTransactionManager
Next, you need to create a Spring PlatformTransactionManager. There are many of them but the one we are interested in is the JtaTransactionManager. This is required as Spring internally uses PlatformTransactionManager for all transactional work.
...
This is really all you need to get JTA support with BTM inside Spring. You could directly make use of the JtaTransactionManager bean in your code but there are more elegant solutions: using Sping's AOP support to get declarative transaction management.
Step
...
6: Configure declarative transaction management
This can easily be achieved thanks to Spring's TransactionProxyFactoryBean.
...