Dear,
Excuse me for not being able to find exact results, I am new to Spring 3.
I am running into questions similar to http://stackoverflow.com/questions/1...ons-precedence.
My question is : will methods = NOT annotated by @Transactional in below pointcut got transaction with default attributes settings at all? Please note that tx:attributes are not specified when <tx:advice/> is an empty tag.
While I think yes because I believe the tx:attributes got default values even if the tag is empty as suggested by the Reference, my colleague argues that there is no transaction at all because TxAdviceBeanDefinitionParser suggests that:
if <tx:attributes> is present then
parse <tx:attributes>
else
instantiate an AnnotationTransactionAttributeSource to determine TX attributes
Would you please help me with code snippet for what happens at runtime? Thanks a lot!!
Code:<bean id="transactionManager_prod1" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory_prod1" /> </bean> <tx:advice id="businessTxAdvise" transaction-manager="transactionManager_prod1" /> <aop:config> <aop:pointcut id="businessPointcut" expression="execution(* com.example..*.*(..)) and @within(org.springframework.stereotype.Service)" /> <aop:advisor advice-ref="businessTxAdvise" pointcut-ref="businessPointcut" /> </aop:config>


Reply With Quote
