Posted by ted780
on January 4, 2006 at 7:44 AM PST
I am having a Threading problem with my Java App. I am running in WSAD 5.1.2 and using Tomcat 4.1 with JRE 1.4.2_08. I have this app Job Groups that users use to assign Job Titles to Job Groups. The system works fine if people log in one by one. But if we have 2 people login at the same time, it fails or returns weird records. List of things I have tried:
1. I have added the 'Synchronized' word to all methods in the app. I realize this may be over kill but had to start somewhere. This was tested and with no change. 2. I coded the App to use one master Form object that is being passed to the Business Objects. This was tested and no change.
3. I tried to utilitize the 'Token' functionality. This used to prohibit people from submitting the same page twice for the same request. This failed as well. I was hoping to customize it to work when sending the object to the database and back to be sure the request had the right one.
4. I then tried to use the 'Thread' class in Struts. I am currently trying to figure how this works. From how I understand it, this assigns a unique number to the request and stores it and you check it when needed to be you in the same thread. Like I said, still trying to figure it out.
5. People are thinking of removing the word 'Static' from the whole App. We some to a certain degree.
So now I am thinking, we can't be the first shop to deal with this issue. Is there anyone out that can help to point me in the right direction? Any help would be greatly appreciated. I have spent way too much time on this already.
Thanks in advance.