Application of Redis in Spring Boot project (III.) problem Discovery and resolution: Reverse serialization Error

Source: Internet
Author: User
Tags redis serialization

Problem 1: Serialization and deserialization problem

Org.hibernate.LazyInitializationException:failed to lazily initialize a collection could not initialize Proxy-no On

This problem occurs because of the use of JPA in spring boot, the massive use of @manytomany, @ManyToOne, @OneToMany, while the Java Persistence API (JPA) in spring boot Because of the configuration problems in the framework of these foreign key data issues on the lazy load and the immediate load of spring boot, the difference can not be used at this time, the two load patterns in the use of the system will have many problems. Typically, on manytomany annotations, there is a duplication of data when the query is loaded with instant loading. And lazy load will appear in the above error information, especially when the data is stored in Redis, because these foreign key information can not load caused an error. On this issue, the ZYW is used to treat these unwanted data on a null-based approach .




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.