通过spring管理事务,但不断刷新后,就会出现程序执行System.out.println("dao========*****##################@@@@@@@@@@@@@@@@@@@@@");后就
不往下执行。public List<T> findByNamedQuery(String hql)
throws DataAccessException {
return getHibernateTemplate().findByNamedQuery(hql);
}
public UserInfoBean getUserBeanBymobile(String userName){
String HQL="FROM UserInfoBean WHERE Mobile='"+userName+"' or Mail='"+userName+"'";
System.out.println("dao========*****##################@@@@@@@@@@@@@@@@@@@@@");
List<UserInfoBean> ulist=super.find(HQL);
System.out.println("dao=1111111111111111111111111=======*****##################@@@@@@@@@@@@@@@@@@@@@");
if(ulist.size()>0)
{
return (UserInfoBean)ulist.get(0);
}
return null;
}事务管理的配置如下:
<bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
        <property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!-- 使用annotation定义事务 
<tx:annotation-driven transaction-manager="transactionManager" proxy-target-class="true" />
 -->
 <!-- Transactional advice -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">   
        <tx:attributes>   
             <!--  methods starting with 'save', 'update' or 'remove' use the default transaction settings --> 
            <tx:method name="save*" propagation="REQUIRED"/> 
            <tx:method name="update*" propagation="REQUIRED"/>   
            <tx:method name="remove*" propagation="REQUIRED"/> 
        </tx:attributes>   
    </tx:advice>   
  
     <!--  ensure that the above transactional advice runs for any execution   
    of an operation defined by specified interface  -->  
    <aop:config>   
        <aop:pointcut id="daoOperation"  
            expression="execution(* com.holpe.common.ShareDao.*(..))"/>   
        <aop:advisor advice-ref="txAdvice" pointcut-ref="daoOperation"/>   
    </aop:config>