ode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From toha.bakanov...@gmail.com
Subject Re: Auto DB schema creation
Date Thu, 12 Apr 2012 15:37:49 GMT
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"/>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message