You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Pavel Ausianik <Pa...@epam.com> on 2002/11/11 15:57:17 UTC
RE: about sharing doc builders
Sanjiva,
Please let me know if you agree to accept my patch, other changes depends on
this.
Thanks,
Pavel
> -----Original Message-----
> From: Pavel Ausianik [mailto:Pavel_Ausianik@epam.com]
> Sent: Wednesday, October 30, 2002 4:36 PM
> To: 'soap-dev@xml.apache.org'
> Subject: RE: about sharing doc builders
>
>
> Sanjiva
>
> see my comments inside. Agree that solution for storing in
> thread assosiated
> storage could work if used alone, the main problem actually that
> DocumentBuilder is not being used only from thread, but also
> stored in the
> Call, Message, ServiceManager, XMLConfigManager , etc.
>
> > Here's the setup:
> > Thread t1, t2;
> > PoolOfCalls pool = new PoolOfCalls ();
> >
> > Thread t1 runs the following code and completes it:
> > Call c = pool.getCall (); // gets call object c1
> > c.<xyz> (...);
>
> XMLParserUtils.getXMLDocBuilder(); // Look at the Document builder
> assosiated with t1 - since we do not have it, create db1
>
> > pool.releaseCall (c);
> >
> > Now comes thread t2 and it does the following:
> > Call c = pool.getCall (); // again gets call object c1
> > c.<xyz> (...);
> > // still running stuff
>
> DocumentBuider db1 has been stored in local var xdb in c1,
> and can still
> parse envelope
>
> >
> > Now thread t1 comes back with the following:
> > Call c = pool.getCall (); // get a new call object c2
> > // however, because the doc builder db1 is associated with the
> > // thread t1, it will be reused, and saved to c2.xdb
>
> db1 used to parse envelope while not finishing parsing in t2
>
>
> Best regards,
> Pavel
>
> --
> To unsubscribe, e-mail: <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
--
To unsubscribe, e-mail: <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>