Yesterday, the customer found a big bug, which is the same information when multiple users, access the same page, may be the same information. The reason is simple, we are in the program, declare the variables: private static int myint. Regardless of how the block is accessed, 10 users accessible information is the same value !! static is a static variable, a bit similar to the Application variable in the ASP. Unlike the Application, static is in memory, no Will release ...
This can also be a concurrent problem .. I originally change this Static to other modifiers, but I have tried and check the information, I found that there is no way .. I can only use the variables used in the page to use session or viewstate. To store ... Session is stored separately for each user, Session will be automatically released for 15 minutes, even if the user is repeatedly logged in, the sessionid is constant, so it is necessary to pay more attention to each time. ... as for ViewState, there is no thorough study now, but viewState is a page of cache .. After a few days, after another, it will be published in the form of comments.
Oh .. I have been in this day, I have to make this trick next year ~~ `(Today, December 31) ... I like MS to launch .NET 2.0 as soon as possible, because in 2.0, the variable can be placed In a hidden control, and .NET 1.1 requires programmers to add, but also set the Width of the control to 0px, so trouble ~~~ Object does not apply this method !!!
After this BUG discovery, I summed up some experience and lessons .... .. people always grow in failure ~~ `` `
Hangzhou is so cold, I hope spring is coming soon ~~ `` `` 2005 all smoothly!!