Why can not state horns be exposed as web services?

综合编程 2018-04-13

I have been reading about Stateful and Stateless session beans and came across a sentence that states that:

Stateful session beans cannot be exposed as web services.

Can anyone elaborate why ?

Every Stateful bean instance located in the EJB Container has an unique object identity.

From spec.: Stateful Session Beans
A stateful session object has a unique identity that is assigned by the container at the time the object is created.

In order to use a Stateful bean, the client code needs to get a Stateful reference from the EJB Container. This reference has to be used to make every future request. Due to the reference object knows the identity associated to the stateful bean, you can be sure that all requests that participate in the "conversation" will be resolved for the same instance bean. This means that the Client has an important role in achieving the stateful behavior.

The SOAP protocol doesn't provide a way that allow to store in a web service client this identity, therefore, if the client doesn't know which stateful instance has the conversational state, every request will be processed by different ejb (such as the case of stateless).

Hello, buddy!

责编内容by:Hello, buddy! (源链)。感谢您的支持!


What is AWS (Amazon Web Service) AWS (Amazon Web Service) is a cloud computing platform that enables user to access on demand comp...
Conditional mutation with dplyr for only a few lin... How to restrict the display menu items on the right click on the nsoutline v...
Android端实现Onvif IPC开发(一)——gSoap移植NDK尝试... Android端实现Onvif IPC开发: 《Android端实现Onvif IPC开发(一)——gSoap移植NDK尝试》 《Android端实现Onvif IPC开...
Spring Security 5 OAuth 2.0 Login and Sign Up in S... Adding social login to a Spring application is now easy with Spring Security 5. It’s well explained...
Best way to call a Web service from SQL What is the best way to call a Web Service from TSQL? I would Like to write some triggers that call ...