hibernate异常处理积累

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;




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值