Z
zorro
Hello there,
To lock or not to lock, that is my question...
I have an arrayList in my application object.
The arrayList contains objects of a class that I defined.
I have my own mechanisms that ensure that only one user at
a time can modify a given object's properties, but another user
could modify another object's properties at the same time
(I want that to be possible). At no time are objects removed
from or added to the arrayList so the list itself stays intact.
Do I need to lock? Concretely:
''''''''''''''''''''''
' in global.asax
dim objGame as Game ' class defined elsewhere
dim games as arraylist
for i = 0 to x
objGame = new Game()
games.add(objGame)
next
application("games") = games
'''''''''''''''''''''
' on some page i extract a game from the arrayList and modify the gameStatus
dim objGame as game = getGame(someGameId, ctype(application("games"),arrayList))
objGame.setStatus("started")
''''''''''''''''''''''''
My own mechanisms prevent objGame from being accessed by
more than one user at a time. But other users can access other games.
Is it necessary to write
application.lock
dim objGame as game = getGame(gameId, ctype(application("games"),arrayList))
objGame.setStatus("started")
application.unlock
??
To lock or not to lock, that is my question...
I have an arrayList in my application object.
The arrayList contains objects of a class that I defined.
I have my own mechanisms that ensure that only one user at
a time can modify a given object's properties, but another user
could modify another object's properties at the same time
(I want that to be possible). At no time are objects removed
from or added to the arrayList so the list itself stays intact.
Do I need to lock? Concretely:
''''''''''''''''''''''
' in global.asax
dim objGame as Game ' class defined elsewhere
dim games as arraylist
for i = 0 to x
objGame = new Game()
games.add(objGame)
next
application("games") = games
'''''''''''''''''''''
' on some page i extract a game from the arrayList and modify the gameStatus
dim objGame as game = getGame(someGameId, ctype(application("games"),arrayList))
objGame.setStatus("started")
''''''''''''''''''''''''
My own mechanisms prevent objGame from being accessed by
more than one user at a time. But other users can access other games.
Is it necessary to write
application.lock
dim objGame as game = getGame(gameId, ctype(application("games"),arrayList))
objGame.setStatus("started")
application.unlock
??