I developed a forum (BBS) by myself. The basic thing is to enable the users to post new topic and follow topics. Also the user need to be able to view the topic list and the detailed content of each topic. When they are posting a topic (new or follow), they can also upload a attachment.
To implement these functions, I have several files (which may have problem), they are: topics.jsp, details.jsp, newTopic.jsp, followTopic.jsp, upload.jsp. Also, I use forumID, topicID, and postID to uniquely identify a post (like every forum)
All these functions work perfectly in normal situations. But occasionally, when there are about 20 active people (registered users) on my website (about more than 100 visitors at that moment), serval of them are trying to post. The following problem may come (not always):
1. When they are trying to view the post details (called details.jsp file), they get the content of another post. You can see from URL address in IE, the forumID, topicID are correct, but the details are from another seems random one. And normally, in one page, I set it to show 10 posts of one topic. But if such thing happened, it can only show one post sometimes. And sometimes, the first several posts are correct, but the last several post are from other topic with different forumID and topicIDs. But if you refresh the page, most probably, you will get the correct content.
2. When people try to reply (follow) a topic, the post is appended to another topic, which means the same. The forumID and the topicID was confused the system.
3. When people were trying to upload a file, I firstly put the file in a temporary directory under somedirectory/userID/ and then move it to the destination. But sometimes, the attachment cannot be found when the system was trying to move it because the file had been put to a directory like:
somedirectory/anotheruserID.
And I know that the user of userID and the user of anotheruserID were both active at that moment.
I am coding all these function in
JSP and mysql, using Apache and
tomcat.
All the 3 problems all look similar, which may be due to the synchronization problem or, anyway, because the system confused of processing the request from diffrent users.
Anybody please kindly give me some idea? Thanks very very much!