Announcement Announcement Module
Collapse
No announcement yet.
expression="target(com.springaop.product.dao.Produ ctDao)" not working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • expression="target(com.springaop.product.dao.Produ ctDao)" not working

    I have defined a declarative transaction with REQUIRED Attibute, ProductDaoImpl is implementing ProductDao

    Code:
    	<bean id="productTransactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager" >
    		<property name="sessionFactory" ref="sessionFactory"/>
    	</bean>
    
    	<tx:advice id="productTxAdvice" transaction-manager="productTransactionManager">
    		<!-- the transactional semantics... -->
    		<tx:attributes>
    			<!-- all methods starting with 'find' are read-only -->
    			<tx:method name="find*" read-only="true" propagation="SUPPORTS" />
    			<!-- other methods use the default transaction settings (see below) -->
    			<tx:method name="save*" read-only="false" propagation="REQUIRED" />
    		</tx:attributes>
    	</tx:advice>
    
        <aop:config>
    		<aop:pointcut id="productDAOOperation" expression="target(com.springaop.product.dao.ProductDao)"/>
    		<aop:advisor advice-ref="productTxAdvice" pointcut-ref="productDAOOperation"/>
    	</aop:config>
    
    	<aop:config>
    		<aop:pointcut id="productQohDAOOperation" expression="target(com.springaop.product.dao.ProductQohDao)"/>
    		<aop:advisor advice-ref="productTxAdvice" pointcut-ref="productQohDAOOperation"/>
    	</aop:config>
    </beans>
    Problem:

    When I try to call Save on ProductDaoImpl, ProductQohDao in a single call, but they are not getting executed in Transaction, please help

    Thanks,
    Vijay

  • #2
    My suggestion is, switch to <tx:annotation-driven/> and @Transactional...it will save you a lot of trouble...just looking at your so many lines of configuration makes my head ache...

    Comment

    Working...
    X