Bonjour,
J'ai défini une relation avec LAZY
Lorsque je retourne l'objet et que je veux parcourir la liste, j'ai cette erreur.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 @ManyToMany(cascade = CascadeType.ALL, fetch=FetchType.LAZY) @JoinTable(name = "cours_eleve") public Set<Cours> getCours() { return cours; }
Comment je peux contourner ce problème en gardant l'attribut lazy ?An attempt was made to traverse a relationship using indirection that had a null Session.This often occurs when an entity with an uninstantiated LAZY relationship is serialized and that relationship is traversed after serialization.To avoid this issue, instantiate the LAZY relationship prior to serialization.
Merci
Partager