<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' er from transaction definition.
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' er from transaction definition.
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货