1.在写Student.hbm.xml 中, hibernate-mapping 中 指定类和数据库对应的表字段时,不小心将property写为properties,报错: ERROR: HHH000196: Error parsing XML (2) : The content of element type "class" must match "(meta*,subselect?,cache?,synchronize*,comment?,tuplizer*,(id|co…
Hibernate中evict方法和clear方法说明 先创建一个对象,然后调用session.save方法,然后调用evict方法把该对象清除出缓存,最后提交事务.结果报错: Exception in thread "main" org.hibernate.AssertionFailure: possible nonthreadsafe access to session.如果 用的不是evict方法,而是clear方法来清session缓存的话,就不会报错. 1.session.e…
Hibernate常见错误合集 1.错误:object references an unsaved transient instance - save the transient instance before flushing: com.xxxx.bean.java.Sysblog; nested exception is org.hibernate.TransientObjectException: object references an unsaved transient insta…