ASP.NET session switch

Le
cti
Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks
Vidéos High-Tech et Jeu Vidéo
Téléchargements
Vos réponses
Gagnez chaque mois un abonnement Premium avec GNT : Inscrivez-vous !
Trier par : date / pertinence
Patrice
Le #17917241
Typically this is an incorrect usage of static (c#) or shared (VB)
variables. They are shared by the whole application and ASP.NET runs as a
single application. So if multiple users are hitting the site at the same
time they'll work on the same data sometimes resulting in displaying other
users data.

Do you have static or shared variable in the part that causes this problem ?

--
Patrice

"cti" discussion :

Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks


Delf
Le #17919831
Il se trouve que cti a formulé :
Hi,

I'm currently developping a website using C# (ASP.NET framework 2.0).
On a page of the site there is a treeview ( 2.0 .Net component) on the
left from which you can open the details of nodes by clicking them. We
have a weird behaviour: sometimes when 2 users are accessing the site
simultaneously, a user gets the other user's data and vice versa.
Does someone have any idea whats's happening?
Thanks



It seems you are using a shared object between user sessions.
Do you use Application["..."] object to store current user data?
cti
Le #17942021
On 21 nov, 17:09, "Patrice"
Typically this is an incorrect usage of static (c#) or shared (VB)
variables. They are shared by the whole application and ASP.NET runs as a
single application. So if multiple users are hitting the site at the same
time they'll work on the same data sometimes resulting in displaying othe r
users data.

Do you have static or shared variable in the part that causes this proble m ?

--
Patrice

"cti" discussion :

Hi,


thanks for your answer .
yes I had static variables and methods but not any more !
Now i instance every object.
I don't have idea any more :(




> Hi,

> I'm currently developping a website using C# (ASP.NET framework 2.0).
> On a page of the site there is a treeview ( 2.0 .Net component) on the
> left from which you can open the details of nodes by clicking them. We
> have a weird behaviour: sometimes when 2 users are accessing the site
> simultaneously, a user gets the other user's data and vice versa.
> Does someone have any idea whats's happening?
> Thanks- Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -


cti
Le #17942191
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf
Il se trouve que cti a formulé :

> Hi,

> I'm currently developping a website using C# (ASP.NET framework 2.0).
> On a page of the site there is a treeview ( 2.0 .Net component) on the
> left from which you can open the details of nodes by clicking them. We
> have a weird behaviour: sometimes when 2 users are accessing the site
> simultaneously, a user gets the other user's data and vice versa.
> Does someone have any idea whats's happening?
> Thanks

It seems you are using a shared object between user sessions.
Do you use Application["..."] object to store current user data?


cti
Le #17942181
On 24 nov, 09:54, cti
Hi,

no , i don't have  Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf


> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on th e
> > left from which you can open the details of nodes by clicking them. W e
> > have a weird behaviour: sometimes when 2 users are accessing the site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?- Masqu er le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.
Delf
Le #17948651
cti a couché sur son écran :

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .



No, the ViewState object is associated with the user Web page only.
It is not because of this...
Delf
Le #17948641
cti vient de nous annoncer :

yes I had static variables and methods but not any more !
Now i instance every object.
I don't have idea any more :(



Can you give us the source code of the object that raises the problem.
And another one that shows us how it is retreived.

Perhaps a singleton instance that manages shared objects?

Thanks.

--
Delf
Patrice
Le #17953571
Likely because it happens when two useds are hitting the site at the same
time.

Knowing how you store the data that seems to be shared would be helpfull in
finding out what goes wrong...

--
Patrice


"cti" discussion :

On 24 nov, 09:54, cti
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf


> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on
> > the
> > left from which you can open the details of nodes by clicking them.
> > We
> > have a weird behaviour: sometimes when 2 users are accessing the site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?-
> Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.


Patrice
Le #17955651
BTW this is a French speaking group. You may want to try an English group
instead unless you speak French too ;-)...



"Patrice" discussion :
Likely because it happens when two useds are hitting the site at the same
time.

Knowing how you store the data that seems to be shared would be helpfull
in finding out what goes wrong...

--
Patrice


"cti" de discussion :

On 24 nov, 09:54, cti
Hi,

no , i don't have Application["..."] object to store current user
data but i use ViewState[""] to store user data .
Can it be the problem ?
Thanks.

On 21 nov, 21:52, Delf


> Il se trouve que cti a formulé :

> > Hi,

> > I'm currently developping a website using C# (ASP.NET framework
> > 2.0).
> > On a page of the site there is a treeview ( 2.0 .Net component) on
> > the
> > left from which you can open the details of nodes by clicking them.
> > We
> > have a weird behaviour: sometimes when 2 users are accessing the
> > site
> > simultaneously, a user gets the other user's data and vice versa.
> > Does someone have any idea whats's happening?
> > Thanks

> It seems you are using a shared object between user sessions.
> Do you use Application["..."] object to store current user data?-
> Masquer le texte des messages précédents -

- Afficher le texte des messages précédents -



There is something about i didn't have take about : the problem is not
systematic .It happen's perhaps one time in the day when there are 20
users using the web site.






Publicité
Poster une réponse
Anonyme