In addition to described SMX4 problem, there is another.
Some times JBI ComponentContext does not contain reference to
TransactionManager. And this doesn't depends on Arries bunble startup... (I
added mandatory reference to TansactionManager in ode-jbi.xml, but
ComponentContext had a null reference to TM). So I see only way to use
additional direct reference to TM from OSGi.
A simple patch
- add to OdeLifeCycle.java property
// Added by Toha: Use OSGI transaction manager if JBI containet lakes it =)
private TransactionManager _transactionManager;
- fix initDataSource() method
// Added by Toha
if (_ode.getTransactionManager()==null)
_db.setTransactionManager(_transactionManager);
else
_db.setTransactionManager(_ode.getTransactionManager());
- add to META-INF/spring/ode-jbi.xml
<bean id="ode-component-lifecycle" class="org.apache.ode.jbi.OdeLifeCycle">
<constructor-arg ref="ode-config-properties"/>
<property name="transactionManager" ref="osgiTransactionManager" />
</bean>
<!-- Toha: OSGI transaction service reference -->
<osgi:reference
id="osgiTransactionManager"
interface="javax.transaction.TransactionManager"/>