Title: Web service implementation with stateful EJB

I believe that I found a problem with the axis EJB provider when a stateful EJB is used as a session scope service implementation.

It seems that the EJB specification is saying that if a runtime exception occurs when calling a stateful EJB, the EJB itself is discarded, meaning that a create on the home interface need to be done again in order to get a new stateful EJB. At least, this is the way JBoss 2.4.4 is working.

Within a regular ejb client code, no big deal, you catch the exception, you do a new create.

In the axis context, from an axis java client calling a session scope service implemented as a stateful ejb, as soon as I get a runtime exception in my ejb, it seems that I am stuck.

With the session scope, axis will cache the ejb client object and as long as my axis session is valid, it will not discard it. So any subsequent call to the web service after a runtime exception will fail with a java.rmi.NoSuchObjectException.

I tried to see if it was possible to invalidate my axis session from the java client, but the session seems to be maintained by the cookie of the HTTPTransport class contained in the static transports Hashtable of the Call class. With Call::getTransportForProtocol, I can get the HTTPTransport object, but I have no way to clear out the cookies. Anyway, in my mind, the proper way to handle that should be a different handling of the cached service object in the EJB provider instead of the reset of the client session.

Is it really a problem or am I missing something? If this is a problem, any suggestions for a workaround? I am also open for suggestions on a potential fix so I can implement it and send it back to you.

Thanks.

Thomas

Reply via email to