1.Getting Exception org.apache.logging.slf4j.SLF4JLoggerContext cannot be cast to org.appache.logging.log4j.core.LoggerContext
- 不能转换异常;
- log4j报错;删除log4j-slf.jar 导入slf4j-log4j.jar(适配器的jar导入不正确导致)。
2.org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
- 过时申明异常。批量更新,预期返回数量1 实际返回数量0;
- hibernate中更新异常,查找更新的数据信息主键是否存在。
3.org.hibernate.TransactionException: nestedtransactions not supported
- 事务异常;
- 嵌套事务不支持;
4.org.hibernate.LazyInitializationException:could not initializatize proxy - no session
- 初始化失败,没找到代理;
- current-session-context-class在hibernatecfg.xml中的参数配置 不是thead;
本文针对Hibernate框架使用过程中遇到的四种常见异常进行详细解析,并提供了解决方案,包括配置问题、事务处理、数据更新及懒加载等方面。
5万+

被折叠的 条评论
为什么被折叠?



