[jdom-interest] static data needs to be thread data for multithreaded applications

Jools Enticknap jools at jools.org
Wed Sep 20 03:09:30 PDT 2000


Nick Reeves wrote:
> 
> Let me make clear first of all I am not asking for individual JDOM Objects
> to be thread safe. I fully agree that the caller should be responsible for
> this, following the example of the Java Collections API.
> 
> However where the class has hidden static data (such as
> Namespace.namespaces)the class must be responsible for making access to this
> thread safe otherwise multithreaded applications such as your typical Web or
> EJB case, have no choice but to single thread all use of the JDOM packages
> :(. This would lead to appalling performance in any realistic use.
> 
> At present multihreaded use of Namespace.getNamespace even indirectly (eg by
> importing files in different threads) will cause random failures with
> ConcurrentModificationException.

Hi Nick

I'm using JDOM in a multithreaded EJB application, and I've not come
across
any issues so far, and I'd hate to have something like this slip through
my 
fingers prior to deployment ;-(

BTW I'm using a fairly simple methodology, one update thread, and
multiple
read threads. I've not seen any problems as yet.

--Jools



More information about the jdom-interest mailing list