Bonjour,

J'ai une page avec un formulaire symfony2, la génération de cette page se passe très bien. Mais le problème c'est quand je veux enregistrer en ajax. J'ai un retour du serveur apres 6-7 min d'attente. Au début je pensai que c'était le formulaire de mon entité qui posé problème car il est complexe. J'ai pas mal de relation OnetoMany donc il y a pas mal de sous-Formulaire (formulaire imbriqué). Donc j'ai tout refais sans utilisé le formulaire de symfony et c'est toujours pareil. En fait je me suis rendu compte que c'était lors de l'enregistrement que ca planté... c'est a dire le flush(). Le problème c'est que sur mon pc ca marche très bien, c'est très fluide. Mais quand je le met sur un serveur ( en réseau local ou sur OVH) j'ai ce problème de flush seulement pour cette page. J'utilise mysql innoDB.
Peut-être que c'est déjà arriver a quelqu'un?
Sinon je vous met le code de mon entité qui pose problème :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
 
<?php
 
namespace XXX\YYYBundle\Entity;
 
use Doctrine\ORM\Mapping as ORM;
 
/**
 * IML\IceBundle\Entity\Informations
 *
 * @ORM\Table(name="informations")
 * @ORM\Entity(repositoryClass="XXX\YYYBundle\Entity\InformationsRepository")
 * @ORM\HasLifecycleCallbacks
 */
class Informations
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;
 
    /**
     * @var float $poids
     *
     * @ORM\Column(name="poids", type="float",nullable=true)
     */
    private $poids;
 
    /**
     * @var float $taille
     *
     * @ORM\Column(name="taille", type="float",nullable=true)
     */
    private $taille;
 
    /**
     * @var datetime $dateCreation
     *
     * @ORM\Column(name="dateCreation", type="datetime")
     */
    private $dateCreation;
 
    /**

     *
     * @ORM\ManyToOne(targetEntity="IML\IceBundle\Entity\Code\GroupeSanguin")
     */
    private $groupeSanguin;
 
    /**

     *
     * @ORM\OneToMany(targetEntity="PersonnelSante",mappedBy="informationsSante",cascade={"persist", "remove", "merge"}, orphanRemoval=true)
     */
    private $personnelSante;
 
    /**
     * @var Doctrine\Common\Collections\Collection $information
     *
     * @ORM\OneToMany(targetEntity="Information",mappedBy="informations",cascade={"persist", "remove", "merge"}, orphanRemoval=true)
     */
    private $information;
    /**
    * @var Doctrine\Common\Collections\Collection $piecejointe
    *
    * @ORM\OneToMany(targetEntity="PieceJointe",mappedBy="informations",cascade={"persist", "remove", "merge"}, orphanRemoval=true)
    */
    private $piecejointe;
 
 
    /**
    * @var string $dmp 
    *
    * @ORM\Column(name="dmp", type="text", length=50)
    */
    private $dmp;
 
 
    public function __construct()
    {
    	$this->personnel = new \Doctrine\Common\Collections\ArrayCollection();
    	$this->information = new \Doctrine\Common\Collections\ArrayCollection(); // ?
    	$this->piecejointe= new \Doctrine\Common\Collections\ArrayCollection();
    }
 
 
    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }
 
    /**
     * Set poids
     *
     * @param float $poids
     */
    public function setPoids($poids)
    {
        $this->poids = $poids;
    }
 
    /**
     * Get poids
     *
     * @return float 
     */
    public function getPoids()
    {
        return $this->poids;
    }
 
    /**
     * Set taille
     *
     * @param float $taille
     */
    public function setTaille($taille)
    {
        $this->taille = $taille;
    }
 
    /**
     * Get taille
     *
     * @return float 
     */
    public function getTaille()
    {
        return $this->taille;
    }
 
    /**
     * Set dateCreation
     *
     * @param datetime $dateCreation
     */
    public function setDateCreation($dateCreation)
    {
        $this->dateCreation = $dateCreation;
    }
 
    /**
     * Get dateCreation
     *
     * @return datetime 
     */
    public function getDateCreation()
    {
        return $this->dateCreation;
    }
    /**
    * Set dmp
    *
    * @param string $dmp
    */
    public function setDmp($dmp)
    {
    	$this->dmp = $dmp;
    }
 
    /**
     * Get dmp
     *
     * @return string
     */
    public function getDmp()
    {
    	return $this->dmp;
    }
    /**
     * Set $groupeSanguin
     *

     */
    public function setGroupeSanguin(Code\GroupeSanguin $groupeSanguin)
    {
        $this->groupeSanguin = $groupeSanguin;
    }
 
    /**
     * Get $groupeSanguin
     *
     * @return XXX\YYYBundle\Entity\Code\GroupeSanguin 
     */
    public function getGroupeSanguin()
    {
        return $this->groupeSanguin;
    }
 
    /**
     * Set personnelSante
     *
     * @param XXX\YYYBundle\Entity\Personnel $personnel
     */
    public function addPersonnel( Personnel $personnel)
    {
        $this->personnel[] = $personnel;
    }
 
    /**
     * Get personnelSante
     *
     * @return Doctrine\Common\Collections\Collection $personnel
     */
    public function getPersonnel()
    {
        return $this->personnel;
    }
 
    /**
     * Set informationSante
     *
     * @param XXX\YYYBundle\Entity\Information  $information
     */
    public function addInformation(Information $information)
    {
        $this->information[] = $information;
    }
 
    /**
     * Get information
     *
     * @return Doctrine\Common\Collections\Collection $information
     */
    public function getInformation()
    {
        return $this->information;
    }
 
    public function addPiecejointe(PieceJointe $piecej)
    {
    	$this->piecejointe[] = $piecej;
    }
 
    /**
     * Get piecejointes
     *
     * @return Doctrine\Common\Collections\Collection $informationSante
     */
    public function getPiecejointe()
    {
    	return $this->piecejointe;
    }
 
    /**
     * Calcul de l'IMP
     * 
     * 
     * */
    public function getImc()
    {
    	$res=0;
    	if($this->getPoids()!=0 && $this->getTaille()!=0 )
    		$res=round((($this->getPoids()/($this->getTaille()*$this->getTaille()))*10000),1);
 
    	return $res;
 
    }
 
 
    /**
     * PrePersist
     * 
     * @ORM\PrePersist
     */
    public function prePersist()
    {
    	if ( is_null( $this->dateCreation )) {
    		$this->dateCreation	= new \DateTime();
    	}
    }
}