報錯:
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.MANUAL):
dao代碼:
public void save(LessModel lm) {
this.getHibernateTemplate().save(lm);
}
解決辦法:
上述代碼修改爲
public void save(LessModel lm) {
this.getHibernateTemplate().setFlushMode(2);
this.getHibernateTemplate().save(lm);
}