我执行数据库操作的时候一直报出:org.springframework.dao.InvalidDataAccessApiUsageException:Writeoperationsarenotallowedinread-onlymode(FlushMode.MANUAL):TurnyourSessionintoFlushMode.COMMIT/AUTOorremove'readOnly'markerfromtransactiondefinition.这个错误。applicationContext.xml:class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"> org.hibernate.dialect.MySQLDialectupdate true update thread
classpath:/com/sx/bean/*.hbm.xml class="org.springframework.orm.hibernate5.HibernateTransactionManager"> class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true">PROPAGATION_REQUIRED PROPAGATION_REQUIRED PROPAGATION_REQUIRED readOnly UserDao下的save方法:publicbooleansave(Useruser){try{getHibernateTemplate().save(user);}catch(RuntimeExceptione){System.out.println("UserDao>>save>>"+e);returnfalse;}returntrue;}每次调用Dao方法都会报出上述那个错误,求救。。。。。
千万里不及你
犯罪嫌疑人X
相关分类