Hi there,

for a student job we're developing a newsgroup system for mobile devices 
(Compaq Ipaqs).

Currently, we have some trouble with the deployed service class. On 
desktop computers everything works fine, but the slow ipaqs showed up 
some strange deadlock problem, which hasn't been detected before.

Each ipaq owns a server thread and a client thread. The server thread 
offers the deployed service interface (methods mainly for requesting 
messageids and messages) and the client thread is looking for new 
servers and downloading messages on detection. On detection of another 
ipaq in the wlan, both try to send a soap request to the other one's 
server, which should return a vector with message ids or just messages, 
which are available for download.

When a server thread receives a soap request from a client, it first has 
to call private methods in its own interface via soap for calculating 
the results. This does not work, because the first soap request (from 
the client) has not been finished and no soap response has been sent 
back, so the interface class blocks method invokation (second internal 
soap request) until the first (client) soap request has really finished. 
That's why the client soap request result blocks forever -> deadlock.

So the problem seems to be, that apache soap can't handle soap requests 
in parallel. My question is now: is this assumption correct or did we 
make any errors ? Is it in general impossible in java, to call two 
(different) methods on the same object from two threads ? I don't think 
so, but u never know :S

Note:
- It's not possible to slice the service interface into several classes 
for multithreading, because data between more than one interface can't 
be shared (at least i do not know, how this should be done, because 
several deployed interfaces have no references to each other).

- There're no synchronized blocks in the service interface (neither in 
the whole implementation), which could explain the blocking behaviour.

Regards,
 Alexander Rau

Reply via email to