Spring懒加载

Spring默认是在启动时立刻加载所有配置的bean,这个行为是可以被改变的,也就是改变为在使用时再加载bean,这就是懒加载。

spring配置文件的beans节点可以加上default-lazy-init=”true”来开启懒加载。

某个bean如果不想使用懒加载可以在bean节点上加上lazy-init=”false”来关闭懒加载

原创文章,作者:geekgao,如若转载,请注明出处:https://www.geekgao.cn/archives/85

发表评论

电子邮件地址不会被公开。 必填项已用*标注

评论列表(1条)

  • kd 12
    kd 12 2020年9月19日 上午8:46

    There are certainly a lot of details like that to take into consideration. That is a great level to convey up. I provide the ideas above as basic inspiration however clearly there are questions like the one you deliver up where the most important factor will probably be working in sincere good faith. I don?t know if greatest practices have emerged round issues like that, however I am sure that your job is clearly recognized as a good game. Each girls and boys feel the impression of just a second抯 pleasure, for the rest of their lives.

GitLab GitHub
分享本页
返回顶部