on 2022 May 16 8:33 AM
Hi everybody,
I'm currently looking at the SAP Commerce OCCv v2 API, which is declared to be stateless. If I want to to an addToCart for example (CartsController::createCartEntry -> addCartEntryInternal), I see that the Controller uses the bean commerceWebServicesCartFacade2 for this operation. But this bean, in the end, is not retrieving the cart by the given cartID from the OCC API, instead it is retrieving the cart by doing getCartService().getSessionCart().
I would have expected that the commerceWebServicesCartFacade2 is not handling anything regarding to a session. Can someone help me with that?
Thank you in advance!
Request clarification before answering.
At the request level, OCC v2 is stateless. For example there is no use of the JSESSIONID cookie and so no session that ties together different request.
However internal to the request there is a filter that creates a local session for the duration of the request. That is done because many of the internal services expect data in the session context (for historical reasons, such as support for the accelerators) & so it needs to be populated for correct functioning of the system. In this OCC setup however, you can think of the local session as logically having request scope only.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Correct. And this is why OCC v2 is described as stateless
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.