(02-09-2020, 07:03 AM)DanBarclay Wrote:That needs more explanation.(02-08-2020, 06:17 AM)SorenJensen Wrote: The problem started when we were 3-4 users at the same time. Whether trying the same or different forms, we all experiences the problems with AV and picture.data error described above.Just as a little background, IW uses multiple threads. There is a new thread with each response from a client/browser. A click or other action from the browser launches a thread on the server. That thread processes the event until it finishes (ex: returns a response to the browser).
Notice: I'm not (deliberately, or as far as I know) using threads.
So, if two users simultaneously call the same code that is not thread safe then you'll have multiple threads using thread unsafe code.
Dan
I have some variables declared as session variables but almost all of them are declared in the implementation part of the unit. For example I create bmp: TBitmap in form onCreate and remove it in form onDestroy. I expect the bmp variable to be different for each user. All forms, while creating them, should, as I expect, belong to the user's session. So the bmp should be independent for each user connected at the same time to a different session. But now I see the same variable is shared between users, which should not happen. When I use
TIWForm1.Create(WebApplication).Show
in fact user2 gets the same implementation part variables as user1 has got. User1 sees variables of user2 and vice versa!!
But moving a number of variables from many forms to usersession unit does not make sense, does it? This way intraweb is of no use to me.