axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shantanu Sen <s...@pacbell.net>
Subject Question on TypeMappingImpl of axis client on a multi-threaded env
Date Sat, 22 Jan 2005 01:46:56 GMT

We have a set of generated stubs talking to multiple web services. Our env is multithreaded
and we are running on a multi cpu system. When a call comes in to each of our client (axis
client stub) we are configuring the client so that each client uses a custom EngineConfiguration
(basically a subclass of org.apache.axis.AxisEngine.SimpleProvider) which uses a custom transport
handler to push the call to the service.

We were using a static class for the EngineConfiguration implementation. This worked fine
on a multi-threaded env on a single CPU system, but on a multi cpu system we faced the following
error.

At random, the types registered in the TypemappingRegistry would lose the mapping of a XML
to Java type. This would typically occur when the client is trying to find a deserializer
to deserialize a response. 

We are attributing it to the fact that TypeMappingImpl stores the mappings in HashMaps (qName2Pair,
class2Pair etc), and hashmap is not thread safe. So it seems that TypeMappingImpl is designed
to be used in a thread safe env which has to be ensured by the client.

Any pointers on this? Does the AXIS architecture warrant that when each thread instantiates
a client, a new instance of EngineConfiguration is required so that the type mapping registry
is thread safe? 

Thanks,

Shantanu Sen

Mime
View raw message