Hi,
I need to make my jsr181 pojo transactional. If I proxy the pojo using the
Spring TransactionProxyFactoryBean, I lose the annotations since the pojo
webservice annotations are not available in the proxy (see spring
configuration below). So when I use this proxy as a jsr181 component, I get
the 'annotations not found' error. I can get around this by delegating the
jsr181 pojo calls to another transaction proxied pojo but is this the
preferred method?
Cheers,
Hari.
<sm:container
id="jbi"
monitorInstallationDirectory="false">
<sm:activationSpecs>
<sm:activationSpec>
<sm:component>
<jsr181:component>
<jsr181:endpoints>
<jsr181:endpoint
annotations="jsr181"
service="xfire:OrderService"
endpoint="OrderService"
pojo="#orderService">
</jsr181:endpoint>
</jsr181:endpoints>
</jsr181:component>
</sm:component>
</sm:activationSpec>
<sm:activationSpec>
<sm:component>
<http:component>
<http:endpoints>
<http:endpoint
service="xfire:OrderService"
endpoint="OrderService"
targetService="xfire:OrderService"
role="consumer"
locationURI="http://localhost:8192/OrderService/"
defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
soap="true"/>
</http:endpoints>
</http:component>
</sm:component>
</sm:activationSpec>
</sm:activationSpecs>
</sm:container>
<bean id="jdbcTemplate"
class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="jdbcTransactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
</bean>
<bean id="transactionAttributeSource"
class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
<property name="properties">
<props>
<prop key="*">PROPAGATION_REQUIRED, -Throwable</prop>
</props>
</property>
</bean>
<bean id="transactionTemplate" abstract="true"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
lazy-init="true">
<property name="transactionManager">
<ref bean="jdbcTransactionManager"/>
</property>
<property name="transactionAttributeSource">
<ref bean="transactionAttributeSource"/>
</property>
</bean>
<bean id="orderService" parent="transactionTemplate">
<property name="target">
<bean class="com.company.OrderService">
<property name="jdbcTemplate">
<ref bean="jdbcTemplate"/>
</property>
</bean>
</property>
</bean>
--
View this message in context:
http://www.nabble.com/Spring-transaction-proxy-with-jsr181-POJO-tf2064171.html#a5686631
Sent from the ServiceMix - User forum at Nabble.com.