on 02-22-2007 1:26 PM
Hi,
Im experiencing some strange behaviour. I have an application, which per logged-in user in portal, receives a list of assigned tasks to that user. I divide these tasks in different queues and use a hashmap to provide a link between the task and the queue ( taskid as key, queueId as value)
This works nicely only.....When 2 user log into the portal at the same time, it seems to mix up tasks. I store the maps and lists in the context only 1 hashmap i have as a class variable....being private static HashMap mapOfTaskTypesWithTaskDetailLists = new HashMap();
Could this be the cause of the problem? That for some reason the variable isnt unique per logged-in user but is somehow shared between the sessions on the server?
I'm curious to your ideas.....
Much thanks and regards,
Hugo
Hugo,
Static class variable is exactly the cause -- it is shared between all instances of the class, so there is no "per logged-in user" divide.
If you remove "static" modifier then you get unique variable per controller instance -- i.e. even if same user running several applications, every application will have own per-user set of tasks/queues.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hugo,
Yes, this would be the same: context node with cardinality 0..n and 2 attributes (one for task, second for queue) is essentially same as your Map.
Valery Silaev
SaM Solutions
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.