Hiya, I hadn't considered thread-safety, so I'm very glad this came up. Are you (collectively) saying that there is a potential problem with the following scenario?
- multiple users in a servlet application - each referencing their own xml document (no concurrent access to the same document) - each frequently reading from and writing to their document in a native XML DB - The Castor value objects for each client stored in HttpSession If so, then you're saying we need to throttle the servlet to one operation at a time? (Please tell me that isn't so) > -----Original Message----- > From: Conor Allen [SMTP:[EMAIL PROTECTED]] > Sent: Friday, January 31, 2003 9:55 AM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] Using Castor safely in Servlets > > You can synchronize on the servlet itself or make the servlet single > threaded. > > Conor > > -----Original Message----- > From: Robert Kent [mailto:[EMAIL PROTECTED]] > Sent: 31 January 2003 14:17 > To: [EMAIL PROTECTED] > Subject: [castor-dev] Using Castor safely in Servlets > > Hi - > > I was able to get rid of some of my more frustrating problems when I > realized that I was trying to use Castor in the wrong situation (eg, > JSPs > instead of Servlets). However, I recall from the Castor website that > the > libraries are not thread safe. Servlet code must be. > > My question: how can I use Castor in a threadsafe way? Is there an > appropriate variable or variables I can synchronize on? Would it be the > JDO > object? The Database? The individual mapped objects? > > One example of what I must do is fetch an object from the database via > an > OQL query, change one or more fields, and then commit() the changes. > Where > should I use synchronize to make this threadsafe? > > Any pointers to more detailed docs about Castor and threading would be > greatly appreciated. > > > Thanks, > _________________________________ > > Robert Kent - (617) 413-3510 > http://www.rjk-comm.com/ > _________________________________ > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > > > > -- > > This e-mail is confidential and is intended for the named recipient only. > If > you receive it in error please destroy the message and all copies. Kainos > Software Ltd. does not accept liability for damage sustained as a result > of > malicious software (e.g. viruses). Kainos does not accept liability for, > or > permit, the creation of contracts on its behalf by e-mail, the publication > of > any defamatory statement by its employees by e-mail, or changes > subsequently > made to the original message. The Company's registered office is located > at > 4-6 Upper Crescent, Belfast, BT7 1NT, Northern Ireland, Tel +44 28 9057 > 1100. > > ----------------------------------------------------------- > If you wish to unsubscribe from this mailing, send mail to > [EMAIL PROTECTED] with a subject of: > unsubscribe castor-dev > ------------------------------------------------------------------------------ CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately notify the sender by e-mail at the address shown. This e-mail transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright (c) 2003 CIGNA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
