LazyInitializationException uniquement par webservice
Bonjour,
J'ai un EJB Entite Client
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
public class Client implements Serializable {
@Id
@GeneratedValue(strategy=IDENTITY)
private int id;
private String prenom;
private Date naissance;
private String nom;
private String login;
private String email;
private String password;
@Embedded
private Adresse adresse;
@OneToMany(mappedBy="client")
private List<Commande> commandes;
... |
un EJB Session qui me permet de retrouver un client par code. PAr exemple dans une interface swing ou avec jsf en utilisant la commande
Mon problème de Lazy, survient lorsque je transforme mon bean de session en
webservice. et lorsque j'appelle mon service web depuis un page php.
Code:
1 2 3 4 5
|
<?php
$client = new SoapClient("http://localhost:8080/ClientBeanService/ClientBean?wsdl", array("trace" => 1));
$param=array("arg0"=>"2");
$result=$client->findClientByCode($param); |
Sur mon serveur JBoss, j'ai alors l'erreur
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: cnam.entite.Client.commandes, no session or session was closed
Comment forcer le service web à ne pas essayer de retourner ma liste des commandes ?
J'espère avoir été claire :oops:
Merci pour vos réponses :)