Bonjour à tous,
Nous avons une application asp.net qui fonctionne très bien en local. Lorsque je déploie celle-ci sur le serveur web, une exception est générée. Cette exception est générée de manière très aléatoire (souvent au bout d'un certains temps d'utilisation).
Voici l'exception :
Pour accéder à la base de données, nous utilisons les DataSet. Et si je regarde le code généré à la ligne incriminée (dans le fichier Designer.cs) :System.InvalidOperationException: La méthode ne peut pas être appelée lorsqu'il existe un DataReader ouvert associé à la commande.
at IBM.Data.DB2.iSeries.iDB2Command.set_UseOptimisticUpdateColumns(Boolean value)
at Inventaire.DAL.InventaireDataSetTableAdapters.INV_LISTE_DETAILS_RES_LIGHTTableAdapter.GetListeDetailsComptesByEmplacement(Nullable`1 ID_LISTE, String EMPLACEMENT, String ETABLISSEMENT, String DEPOT) in D:\Projets\InventaireSolution\InventaireDAL\InventaireDataSet.Designer.cs:line 19983
Pour la petite histoire, nous faisons tourner l'application sur un pool applicatif séparé.
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 [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.ComponentModel.Design.HelpKeywordAttribute("vs.data.TableAdapter")] [global::System.ComponentModel.DataObjectMethodAttribute(global::System.ComponentModel.DataObjectMethodType.Select, false)] public virtual InventaireDataSet.INV_LISTE_DETAILS_RES_LIGHTDataTable GetListeDetailsComptesByEmplacement(global::System.Nullable<decimal> ID_LISTE, string EMPLACEMENT, string ETABLISSEMENT, string DEPOT) { this.Adapter.SelectCommand = this.CommandCollection[3]; if ((ID_LISTE.HasValue == true)) { this.Adapter.SelectCommand.Parameters[0].Value = ((decimal)(ID_LISTE.Value)); } else { this.Adapter.SelectCommand.Parameters[0].Value = global::System.DBNull.Value; } if ((EMPLACEMENT == null)) { this.Adapter.SelectCommand.Parameters[1].Value = global::System.DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[1].Value = ((string)(EMPLACEMENT)); } if ((ETABLISSEMENT == null)) { this.Adapter.SelectCommand.Parameters[2].Value = global::System.DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[2].Value = ((string)(ETABLISSEMENT)); } if ((DEPOT == null)) { this.Adapter.SelectCommand.Parameters[3].Value = global::System.DBNull.Value; } else { this.Adapter.SelectCommand.Parameters[3].Value = ((string)(DEPOT)); } InventaireDataSet.INV_LISTE_DETAILS_RES_LIGHTDataTable dataTable = new InventaireDataSet.INV_LISTE_DETAILS_RES_LIGHTDataTable(); this.Adapter.Fill(dataTable); return dataTable; }
Si aucune application ne tourne sur les autres pools applicatifs alors l'exception ne se produit pas. Par contre, si nous lancons les autres applications sur les autres pools applicatifs alors l'exception se produit.
Lorsque cette exception se produit alors toutes les autres pages sont encore disponibles (sauf celle qui contient la requete ci-dessus). Pour régler le problème, nous recyclons le pool applicatif.
Mon environnement technique :
- base de données : iSeries DB2
- serveur Web : Windows Server 2008 R2 / IIS 7
- framework .Net 3.5
Si vous avez des idées sur l'origine du problème, je suis preneur car je commence à être à bout de solutions.
Merci d'avance et bonne journée
Luc
Partager