Giter VIP home page Giter VIP logo

fish's Introduction

Hi 👋

fish's People

Contributors

nekolr avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

lidachun

fish's Issues

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.nekolr.fish.entity.User.roles, could not initialize proxy - no Session

User user = userService.findByUsername(username);

复现过程:
登录 -> 创建用户 -> 删除刚创建的用户时会报错:org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.nekolr.fish.entity.User.roles, could not initialize proxy - no Session

Docker build issues

在构建 Docker 镜像的过程中需要通过 mvn clean package 进行项目编译,这个过程会执行项目的测试代码,尝试连接数据库,而此时 maven image 中并没有安装并运行数据库软件(MySQL)。

@Cacheable will affect the lazy loading mechanism of @ManyToMany

User user = userService.findByUsername(username);

在这段代码中,当 User 的信息是通过缓存而不是查询数据库所得时,user 的 roles 属性因为是懒加载的,所以有可能会触发查询数据库的操作,而此时 hibernate session 根本就没有初始化,所以会报错:org.hibernate.LazyInitializationException: failed to lazily initialize a collection, could not initialize proxy - no Session

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.