cancel
Showing results for 
Search instead for 
Did you mean: 

Soft state implementation considerations

ChandraMahajan
Active Contributor
0 Kudos

Hello,

I am going through Soft State Support for OData Services - SAP NetWeaver Gateway - SAP Library and there come across implementation consideration section. I need more information on few points such as,


  • Resources on the server stay occupied as long as the application server session lives. It means that the more services run in soft state mode the more server resources are constantly unavailable. The price you pay for better performance is a higher memory consumption, hence:
    • The soft state timeout should be short.
    • Soft state should only be used in special situations, that is, only for certain entity sets.

1) is there any guideline on what should be the soft state timeout value depending on number of concurrent users (for e.g. 500 to 1000 users)? what other parameters one need to consider while determining soft state timeout value?

2) Soft state should only be used in special situations, that is, only for certain entity sets - soft state feature applies to entire OData service. what is meant by certain entity sets? or I am missing something.

3) Should we consider soft state support for implementing lock mechanism as being discussed in few discussions such as and Or this feature should be specifically used for improving performance by caching data as mentioned by Andre Fischer in the post

By using soft state, the resources/functionality which has been loaded during the initial load can be reused for the subsequent requests of the service. Thus, the main benefit of soft state is a considerable performance optimization of an OData service.

Regards,

Chandra

Accepted Solutions (1)

Accepted Solutions (1)

kammaje_cis
Active Contributor
0 Kudos

Chandra,

Couple of points.

-> Consider a scenario where you have used Softstate for Pessimistic concurrency. The moment softstate time out is reached, the lock on the resource is released, and the user will not know it.

-> Document also says

When working in soft state processing mode, bear in mind that transactional behavior must not be implemented by using the soft state processing mode and is not provided by the SAP NetWeaver Gateway framework.

Anyway, the aim of Softstate is not a 'Complete State', so I would not use for Pessimistic locking. Why don't you try with Websockets. That sounds promising.

Thanks

Krishna

ChandraMahajan
Active Contributor
0 Kudos

Hi Krishna,

Thanks for reply.

regarding soft state timeout, it can be handled as discussed in but I have not tried it yet.

Could you please explain how it can be implemented using websockets? I am following your discussion but not sure how pessimistic locking will be implemented using Websockets.

Regards,

Chandra

kammaje_cis
Active Contributor
0 Kudos

Websocket to be configured as Stateful.

Whenever Business object is edited in UI5, initiate a Websocket connection and create lock on Business Objects. Whenever the websocket connection closes, you can delete the lock.

Answers (2)

Answers (2)

kammaje_cis
Active Contributor
0 Kudos

Just stumbled upon a note. Not directly related, but gives out lot of information.

Please read this note. 2074804 - Soft-state Enablement for Performance Optimization


It talks about Locking, Timeout value etc.

ChandraMahajan
Active Contributor
0 Kudos

Yes I saw that note already. it means though the main purpose of implementing that note is performance optimization, it does implement locking mechanism. but as recommended, 2 minute timeout value seems to be very high.

Also check note 2141567 - SAP FIORI - lock not released when leaving the application

Based on all this information, I guess with careful implementation of soft state feature, pessimistic locking can be implemented.

-Chandra

kammaje_cis
Active Contributor

Softstate itself will not do the locking though. Within the DPC class, we need to call the ENQUE modules. Since we have a session now (say for 2 minutes), locks will be held for two minutes now. Moment two minute gets over, session is dropped, so the lock is released.

But Softstate framework creates another session to execute further calls, but this session will not have the lock.

former_member184739
Contributor
0 Kudos

Hi Chandra,

I think we are sailing in the same boat. Let me share my findings once i am done with the analysis !

Regards

Prabaharan Asokan