[jboss-user] [JBoss Seam] - Re: TransactionalSeamPhaseListener + Spring @Transactional

dapeng do-not-reply at jboss.com
Wed Aug 15 04:35:17 EDT 2007


Hi,

thanks for your answer. It is the first answer I get for my posts in the seam forum. Maybe I have been asking odd questions. Some points are still not quite clear:
1. I am not able to locate the class TransactionalSeamPhaseListener in Seam 2.0? Has it been replaced by the general SeamPhaseListener?
2. Where can I download the 2.0.0. CR1? (you mean RC1?)
3. I want to deploy my application in Tomcat, where no UserTransaction is available in JNDI? I encountered some problem in the class org.jboss.seam.transaction.Transaction, which always exists the method getUserTransaction with a runtime exception: I am forced to disable the seam tx management in components.xml with <core:init debug="true" transaction-management-enabled="false"/> to get rid of the problem. But I think I am then only relying on the spring tx management and might get LazyInitilizationException. Is my understanding right?

<core:manager conversation-timeout="120000" 
  |                   concurrent-request-timeout="500" 
  |                   conversation-id-parameter="cid"/>
  | 
  |     <core:init debug="true" transaction-management-enabled="false"/>
  |     
  |     <spring:context-loader/>
  | 

	<bean id="transactionManager"
  | 		class="org.springframework.orm.jpa.JpaTransactionManager">
  | 		<property name="entityManagerFactory"
  | 			ref="entityManagerFactory" />
  | 		<property name="dataSource" ref="dataSource" />
  | 	</bean>
  | 
  | 	<!--       
  | 		<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
  | 		<property name="persistenceUnitName" value="userDB"/>    
  | 		</bean>
  | 	-->
  | 
  | 	<bean id="entityManagerFactory"
  | 		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  | 		<property name="dataSource" ref="dataSource" />
  | 		<property name="jpaVendorAdapter">
  | 			<bean
  | 				class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
  | 				<property name="showSql" value="true" />
  | 				<property name="generateDdl" value="false" />
  | 				<property name="database" value="MYSQL" />
  | 			</bean>
  | 		</property>
  | 
  | 		<property name="loadTimeWeaver">
  | 			<bean class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/>
  | 		</property>
  | 
  | 	</bean>
  | 
  | 
  | 	<!-- Seam entity manager facrtory 
  | 		<bean id="entityManagerFactory"
  | 		class="org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactoryBean">
  | 		<property name="persistenceContextName" value="entityManager" />
  | 		</bean>
  | 	-->
  | 
  | 	<tx:annotation-driven proxy-target-class="true" />
  | 
  | 	<bean
  | 		class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
  | 
  | 	<bean
  | 		class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" />
  | 
  | 	<bean id="userDao"
  | 		class="com.suzuki.asap.startup.dao.jpa.JpaUserDao" />
  | 
  | 	<bean id="userService"
  | 		class="com.suzuki.asap.startup.service.UserService">
  | 		<property name="dao" ref="userDao"></property>
  | 		<!-- seam:component/-->
  | 	</bean>
  | 
  | 	<bean id="dataSource"
  | 		class="org.apache.commons.dbcp.BasicDataSource"
  | 		destroy-method="close">
  | 		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
  | 		<property name="url" value="jdbc:mysql://localhost:3308/asap" />
  | 		<property name="username" value="root" />
  | 		<property name="password" value="sa" />
  | 		<property name="initialSize" value="2" />
  | 		<property name="maxActive" value="50" />
  | 	</bean>
  | 
  | 	<seam:configure-scopes />
  | </beans>


Thank you for your help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074311#4074311

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074311



More information about the jboss-user mailing list