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:   <mailto:soap-dev-unsubscribe@;xml.apache.org>
For additional commands, e-mail: <mailto:soap-dev-help@;xml.apache.org>

Reply via email to