Migración de transacciones con EJB 2 a Spring 3.1.1
Hola a todos:
Es mi primer post en este foro, aunque llevo mucho tiempo leyendo magníficas explicaciones aquí.
Necesito que alguien me ayude con una duda que tengo.
Estamos migrando un aplicativo hecho con EJB 2 a Spring. La idea es hacerla independiente del servidor de aplicaciones. Tengo el aplicativo con anotaciones, y las transacciones también anotadas. He usado jndi para obtener el datasource de JBoss y org.springframework.jdbc.datasource.DataSourceTransactionManager para el gestor de transacciones. ¿Es ésto correcto?
El application context quedaría como sigue:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jee="http://www.springframework.org/schema/jee"
xsi:schemaLocation="http://www.springframework.org/schema/beans
<a href="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
" title="http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
">http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
</a> <a href="http://www.springframework.org/schema/context
" title="http://www.springframework.org/schema/context
">http://www.springframework.org/schema/context
</a> <a href="http://www.springframework.org/schema/context/spring-context-3.1.xsd
" title="http://www.springframework.org/schema/context/spring-context-3.1.xsd
">http://www.springframework.org/schema/context/spring-context-3.1.xsd
</a> <a href="http://www.springframework.org/schema/tx" title="http://www.springframework.org/schema/tx">http://www.springframework.org/schema/tx</a>
<a href="http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
" title="http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
">http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
</a> <a href="http://www.springframework.org/schema/jee
" title="http://www.springframework.org/schema/jee
">http://www.springframework.org/schema/jee
</a> <a href="http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"" title="http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"">http://www.springframework.org/schema/jee/spring-jee-3.0.xsd"</a> default-autowire="byName">
<context:annotation-config />
<tx:annotation-driven/>
<context:component-scan base-package="com.pruebas.core.implementaciones" />
<context:component-scan base-package="com.pruebas.model.dao.implementaciones" />
<context:component-scan base-package="com.pruebas" />
<bean id="springApplicationContext" class="com.pruebas.utils.SpringApplicationContext"></bean>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:/cipds"></property>
<property name="lookupOnStartup" value="true"></property>
<property name="cache" value="true"></property>
<property name="proxyInterface" value="javax.sql.DataSource"></property>
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
</beans>
<blockcode>
¿Está correcto?
Y si no es así y se debiera implementar el gestor de transacciones de JBoss, ¿cómo se haría?
Muchisimas gracias de antemano por su tiempo.
Un saludo.
- pedrofdez's blog
- Inicie sesión o regístrese para enviar comentarios
Comentarios recientes
hace 9 semanas 1 día
hace 13 semanas 2 días
hace 20 semanas 6 días
hace 28 semanas 6 días
hace 31 semanas 3 días
hace 33 semanas 22 horas
hace 36 semanas 2 días
hace 36 semanas 2 días
hace 42 semanas 2 días
hace 43 semanas 3 días