I have integrated blazeds, spring, and hibernate, using the standard spring-hibernate integration, and the new Spring-BlazeDS integration. However I am unable to get the @transactional annotation to work correctly on my remote-destinations.
Here is what my config looks like:
However, if I try to use @Transactional with the ClientDelegate class, it isn't recognized and I get an exception that a session doesn't exist and can't be created based on the configuration. Here is a snippet of that code:Code:<flex:message-broker> <flex:secured /> </flex:message-broker> <tx:annotation-driven transaction-manager="myTxManager"/> <bean id="clientServiceImpl" class="com.mine.ClientDelegate"> <constructor-arg ref="hibernateDAOFactory" /> <security:intercept-methods> <security:protect method="*" access="ROLE_USER" /> </security:intercept-methods> </bean> <flex:remoting-destination ref="clientServiceImpl"/> <bean id="myTxManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> ... and the various other beans such as the sessionFactory, datasource, etc ...
However, if I don't use annotations, and I use the TransactionProxyFactoryBean like shown below, it works fine:Code:import org.springframework.transaction.annotation.Transactional; @Transactional public class ClientDelegate implements IClientDelegate {
I've also been able to successfully use the @Transactional with a DAO which is not configured as a remoting-destination.Code:<bean id="clientServiceImpl" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"> <property name="transactionManager" ref="myTxManager"/> <property name="proxyInterfaces" value="com.mine.IClientDelegate" /> <property name="target"> <bean class="com.mine.ClientDelegate"> <constructor-arg ref="hibernateDAOFactory" /> </bean> </property> <property name="transactionAttributes"> <props> <prop key="*">PROPAGATION_REQUIRED</prop> </props> </property> <flex:remoting-destination /> <security:intercept-methods> <security:protect method="*" access="ROLE_USER" /> </security:intercept-methods> </bean>
Is there something in the way the new flex/blazeds integration is coded that prevents the use of @Transactional for remoting-destination's?
Thanks.
- David.


Reply With Quote
