A
Andrea
Suppose a base class like
partial class X : Page ...
and a class A that is called from class X somewhere along the code.
I'm not able to understand if for each user connected to the web site, a
thread is created and so every call to class A stay in different thread or
all works into a single thread.
I'm asking this because I've a function the get the last ID of a table in
the db, but I'm worried about that multiple call can return the same number
at same time (since I just get the number) and after I increment it.
What could be a solution? In a multiple thread scenario, the lock statement
sounds good ... but I'm not sure about the scenario it represents.
Thanks
Andrea
partial class X : Page ...
and a class A that is called from class X somewhere along the code.
I'm not able to understand if for each user connected to the web site, a
thread is created and so every call to class A stay in different thread or
all works into a single thread.
I'm asking this because I've a function the get the last ID of a table in
the db, but I'm worried about that multiple call can return the same number
at same time (since I just get the number) and after I increment it.
What could be a solution? In a multiple thread scenario, the lock statement
sounds good ... but I'm not sure about the scenario it represents.
Thanks
Andrea