Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Scoping of class property
Message
De
19/12/2005 04:20:01
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Scoping of class property
Divers
Thread ID:
01079106
Message ID:
01079106
Vues:
78
I am having something weird that I am trying to resolve. I have a Web Service which responds to various needs. Two of the methods are querying for some data. They both are instantiating a data provider object. The code is like this:
        <WebMethod()> _
        Public Function GetWebServiceHit(ByVal tnRecord As Integer) As DataSet
            Dim cData As String
            Dim loDataProvider As Framework.Data = New Framework.Data
            cData = Framework.FileFunction.GetIni(Framework.App.cStartupDirectory + "\Main.ini", "System", "Data")
            CheckLogin()
            If loDataProvider.SQLExec("SELECT TOP " + tnRecord.ToString + _
             " WSH.Numero,WSH.AddDate,WSH.Method,WSH.Lap,Member.Prenom,Member.Nom,WSH.IP FROM WSH " + _
             "INNER JOIN " + cData + _
             "\Member ON WSH.AddUser=Member.Numero ORDER BY WSH.Numero DESC", App.aConnection(1)) = False Then
                Throw New System.Exception(Framework.App.cError)
            End If
            Return loDataProvider.oDataSet
        End Function

        <WebMethod()> _
        Public Function GetHit(ByVal tnRecord As Integer) As DataSet
            Dim lnEXE As Integer
            Dim lnCounter As Integer
            Dim cData As String
            Dim loDataProvider As Framework.Data = New Framework.Data
            cData = Framework.FileFunction.GetIni(Framework.App.cStartupDirectory + "\Main.ini", "System", "Data")
            CheckLogin()
            If loDataProvider.SQLExec("SELECT TOP " + tnRecord.ToString + _
             " Hit.Numero,Hit.AddDate,Hit.NoEXE,Hit.NoProcess,Hit.NoSubProc,Hit.IP,Hit.Lap," + _
             "IIF(ISNULL(Member.Prenom),"""",Member.Prenom) AS Prenom,IIF(ISNULL(Member.Nom),"""",Member.Nom) " + _
             "AS Nom,Hit.WWC,SPACE(40) AS EXE FROM Hit LEFT JOIN " + cData + _
             "\Member ON Hit.AddUser=Member.Numero ORDER BY Hit.Numero DESC", App.aConnection(1)) = False Then
                Throw New System.Exception(Framework.App.cError)
            End If
            Return loDataProvider.oDataSet
        End Function
Framework.Data is a class which contains some public properties such as oDataSet. So, in this case, once the loDataProvider.SQLExec() method is done, I have access to loDataProvider.oDataSet for my data. This works well. The problem is when I launch two simultaneous requests to the Web Service calling each of those respective methods. Basically, when I do this, I am never able to obtain a success on both methods. The situation is that the data is mixed up between those two methods. But, it shouldn't be. loDataProvider is private to each method so this should work. Anyone would have an idea why oDataSet is mixed up when two simultaneous calls are done on those methods?
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform