SSH frame error: org.hibernate.LazyInitializationException:failed to lazily initialize a collection of role.

Source: Internet
Author: User

There are problems when doing the SSH project exercise:

Org.hibernate.LazyInitializationException:failed to lazily initialize a collection of role

The reason for this is the lazy loading of hibernate problems.
In the multi-party configuration does not specify the mode of loading, and the side of the party is lazy loading, so in the acquisition of one side is acquired, but the time to obtain a multi-party session has been closed, it will not get more information, so error.
Workaround:
The loading mode of multiple parties (One-to-many) in one party is changed to load immediately, and one party in the multiparty (many-to-one) changes to lazy loading.
That is, add lazy= "false" (One-to-many) in a one-to-many party


SSH Framework error: org.hibernate.LazyInitializationException:failed to lazily initialize a collection of role.

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.