N
No One
I have an object that needs to have a global scope within my ASP.Net
application. As I can find no way to make this a server component that
has a global scope, I have given it a static constructor for
initializing its inner parts. This is an id generator object for
inserting rows into a particular table (for various reasons the DBA
cannot make this table have a db server generated id). My concern stems
from the calls to the static getNextId() method. How do I do something
similar to Java's synchronized so that only one call happens to this
method at a time to avoid a race condition?
Thanks.
application. As I can find no way to make this a server component that
has a global scope, I have given it a static constructor for
initializing its inner parts. This is an id generator object for
inserting rows into a particular table (for various reasons the DBA
cannot make this table have a db server generated id). My concern stems
from the calls to the static getNextId() method. How do I do something
similar to Java's synchronized so that only one call happens to this
method at a time to avoid a race condition?
Thanks.