<bean id= "txManager "
class= "org.springframework.orm.hibernate3.HibernateTransactionManager ">
<property name= "sessionFactory " ref= "sessionFactory "> </property>
</bean>
<aop:config>
<aop:pointcut id= "defaultDaoOperation "
expression= "execution(* com.test.*.dao.*(..)) " />
<aop:advisor advice-ref= "defaultTxAdvice "
pointcut-ref= "defaultDaoOperation " />
</aop:config>
<tx:advice id= "defaultTxAdvice " transaction-manager= "txManager ">
<tx:attributes>
<tx:method name= "* "/>
</tx:attributes>
</tx:advice>
无论是更新还是保存都出现下弥漫的错误:
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER/MANUAL): Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly ' marker from transaction definition.
------解决方案--------------------
顶