Results 1 to 2 of 2

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

  1. #1

    Default 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. #2
    Join Date
    Jul 2010
    Location
    Venice, Italy
    Posts
    709

    Default

    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...

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •