I don't know your exact design/architecture, but I would urge you to
consider giving each function instance its own XalanSourceTreeDocument
instance and installing multiple instances. It's much cleaner, and you
avoid the problem of using one XalanSourceTreeDocument instance for all
threads. Since the only way to destroy any nodes you've created with a
particular XalanSourceTreeDocument instance is to delete the document,
you'll keep building up nodes until you destroy that document. That means
you'll have to wait until there are no more active threads, then destroy
and re-create the document.
It's much easier to give each function instance its own
XalanSourceTreeDocument instance, and let the function instance be
destroyed after the transformation is complete. That's much easier to do
and has minimal increased overhead. It might even have less overhead, if
you consider how much you'll need to synchronize access to a gobal
XalanSourceTreeDocument instance, and the cost of such a bottleneck. If
you really want to scale your solution, this will be a huge bottleneck.
Dave
Wolfgang Schell
<wolfgang.schell To:
[email protected]
@gmx.de> cc:
Subject: Re: how to create nodes
from an external function
02/12/2002 06:50
AM
> This looks like C++ code, but DOMBuilder is a Java class, so I have no
> idea what you're trying to do.
Of course I meant XalanDocumentBuilder...
> Another option is to have a global XalanSourceTreeDocument instance and
> synchronize access to it, but that requires more code, has a higher
> overhead, and means that nodes will persist until you destroy the static
> instance.
For the moment this seems to be the best way. Thanks for your help!
Cheers,
Wolfgang
--
Wolfgang Schell
[EMAIL PROTECTED]
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net