SpringbootJPA报错could not initialize proxy - no Session

could not initialize proxy - no Session

已解决!!!

今天security时 使用了 多对多关联查询,一直报错could not initialize proxy - no Session

作一下尝试均不能成功!可能是用处不一样吧。给大家列出我未能成功的让大家少跑弯路。

---------以下是未能解决我的问题的(成功解决在分割线下方!)

1:toString()

打断点看了 是 toString()有错但是起因应该是 多表关联 no Session没有查询的问题

2:@Proxy(lazy =false)

问题类 类上注解 懒加载为false无效

3:yaml

jpa:

database:MYSQL

  open-in-view:true

yaml配置文件设置无效

4:@Transactional

在方法处注解事务 无效



以下是正解方法!!!!!!!!!!!!!!!

上面的方法均为采用!!!!!!




新人QQ:712660518

IT资源群:739780996

你可能感兴趣的:(SpringbootJPA报错could not initialize proxy - no Session)