Hi, I'm thinking about ways to architect a XML BBS with JSP. In the BBS there is an XML file, userPosts.xml, that contains lots of user information - username, number of posts, last login, etc - and is accessed by all the XML thread files - one XML file for each topic. Whenever a person adds a message, it first updates/creates the thread XML file and then updates userPost.xml with that user's info. I'm new to JSP - this system is actually in ASP - and I'm wondering what would be the best way to ensure that the userPosts.xml file was only getting opened and re-written by one user at a time? I see that there is the isThreadSafe page directive - can I just have a page that works with userPosts.xml and set isThreadSafe = false? Will that ensure correct marshalling of the processes lined up for the rewriting of this file? Or is there a better, faster way? thanks for any ideas, Scottie Zman
Well, clever as my designs may be, I must admit that the FIRST thing I'd do when changing platforms would be to see if someone hadn't already written one of those that I could steal or adapt (I'd suggest the JavaRanch one, but it's not in Java!). Second suggestion would be to consider forgoing XML and using a DBMS. XML is essentially a sequential medium, not a random-access or skip-sequential one. and I wouldn't recommend it for high-volume use. J2EE has most of its concurrency services written for DBMS'type stuff (there ARE XML-specific DBMS's though). You can use isThreadSafe(), but it constricts the entire process. Much depends on the load.
Customer surveys are for companies who didn't pay proper attention to begin with.
Joined: Aug 08, 2001
>> You can use isThreadSafe(), but it constricts the entire process The entire process being.... just that page and all the visitors who are accessing it, or the entire server?? Does it just line up the requests in a jfirst come first serve manner, or do requests ever get dropped? If it's just the page, then I can probably live with that. Scottie Zman