cancel
Showing results for 
Search instead for 
Did you mean: 

UI5 Ressource Locking

former_member193202
Participant
0 Kudos

hi folks,

i know this theme has been discussed but not really a outcome (for me ?). as s4/hana has a lot UI's with fiori i'm wondering what would be best practice to enqueue logical objects like:

Example Change customer:

User A views a customer master data via a sapgui transaction 

User B edits via a FioriApp the master data of the customer of User A (as stateless the is i guess no lock on the logical object ?)

In the meantime user A switches to edit mode, changing data.(as not locked with enqeue he can switch, or will he get automatically not saved but edited data and how??)

Then User B saves changed data (should there be a call to the enqueue , and what then? as it is during a save-operation - error message to user, or reflecting with new data)

is there a built-in support for locking/sharing logical objects.

any idea what is the solution for such typical use-cases?

with sapgui or webdynpro or any stateful application , these are not really problems, but with stateless apps.

or do we have to handle conflice-documents and how (i hope not ?!)

best  regards,

oliver

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

The concurrency issues can be handled with the implementation of oData using etag feature. WIth SP9 xsodata has built in support to make use of etag. I'm not sure with the Gateway side.


Operations | OData - The Protocol for REST APIs

former_member193202
Participant
0 Kudos

hello

i read about etag and that makes it a bit clearer as long as only stateless-apps are involved. but what if an "old" sapgui-transaction works on the same data, it does not have any knowledge of with etag locked ressources?

or how will this work

best regards

oliver

Former Member
0 Kudos

Makes sense & I don't have an idea on sapgui-transaction!

EkanshCapgemini
Active Contributor
0 Kudos

Hi Oliver,

If a person 'A' has opened a PO at suppose 17:00 and editing it in stateless app. In the SAP GUI someone else (say 'B') opened the same PO at 17:02 and started editing it. These are possible scenario and their results with eTag locking:

1) A clicks on save at say 17:05 but it will not save the PO since the same PO is locked by B. A will get a error message from backend that this object is locked by B

2) A is still editing and B clicks on save at 17:05, it will save data in the backend as edited by B. Now A tries to save it, since last changed time is altered in the backend so Etag values will not match and it will give error to A saying that 'you does not have the latest data.'

Regards,
Ekansh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello All,

As an alternative for the ETag Odata feature you can use an oData service running in a soft state (sessions) mode to control the locks.

For this service you can set up a timeout how long the lock should be active.

In SAPUI5 you can add a progress bar to show the user how long the lock is active.

You can also add a button so the user can refresh the lock by refreshing the session or before the timer reaches zero you can automatically refresh the session.

What do you think about this solution? (only problem I know of: if you lock something else in this session the first lock stays active - but therefore there are also solutions).

Regards,

Gerald.

former_member193202
Participant
0 Kudos

hello gerald,

well i also thougth about that - i think this could be a good solution. but as hearing from sap, with s4/hana and the simplification all transactions would be fiori-like so maybe we only neet the Etag feature as there are no sapgui-transacions any more (in a long term....).

but i used already the stateful feature for services, and yes, this works really well , so your solution should work i think

did you try this already?

regards oliver

Former Member
0 Kudos

Hi Oliver,

Yes I already tried this and it's working.

I think using the ETag feature is not enough if I have many fields or other depending datasets to update in the SAPUI5 front end.

There is also the problem of the old current existing ABAP transactions..

But I really don't know if this is the best solution for this problem.

Regards,

Gerald.

former_member193202
Participant
0 Kudos

hi gerald, we are in front of the same situation, as we will try to build a ui5-app with more functionality to test the environment and the possiblities. i will do it as you described, i think its a good solution.

i hoped sap would give us some more fancy tools to manage this or a statement what the best solution would be.

and hopefully the development environment for ui5 is just in the beginning, in meaning of tools for the customer 😉

regrads oliver

ChandraMahajan
Active Contributor
0 Kudos

Hi Gerald Beitzen- Heineke,

Please refer Soft State Support for OData Services - SAP NetWeaver Gateway - SAP Library and see implementation consideration.


  • The application server session which is used to run the service in soft state mode is always user-specific.

I think soft state feature might not solve the problem because the session executed under soft sate is user specific i.e it will lock the session for that particular user and other user can still access it and can make the changes etc as explained in the original scenario by Oliver Russinger

Can you please confirm using soft state, if user A edits object in fiori (or ui5 app) and user B wants to edit same in backend, user B will get error due to object locked by user A.

I think using soft state, if user A edits object in frontend then the same user A cannot edit it backend till the session timeout time.

Let me know your findings.

Regards,

Chandra

CC -

Former Member
0 Kudos

Hi Chandrashekhar,

The soft state context is indeed always user and browser specific. But the function module enque call for the locking server is global known (normal sm12 entry). If user A edit an object in fiori a user B or A cannot edit the same object in the backend (and the other way round), till the fiori session times out.

The requirement is certainly that in both applications the enque has to be called before changing the object.

Just tested.

But I think it's necessary that also the ETag feature should be used too - if the session times out. But it's also possible to prevent the timeout if a timer in the fiori frontend calls automaticly the backend before the timeout to refresh the session.

Regards,

Gerald.

ChandraMahajan
Active Contributor
0 Kudos

Hi Gerald,

Thanks for testing scenario with 2 users. I will try to implement it once we will be on SP09.

I opened this discussion and raised few points. my main concern is should we consider soft state feature especially to improve the performance as described below

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.

Can we consider this as one more option/alternative to implement lock mechanism along with ETag feature? SAP should provide some official guidance on it.

Regards,

Chandra

Former Member
0 Kudos

Hi, we implemented the locking mechanism in UI5 application using a "hybrid" stateful/stateless state of the application in particular context. No Fiori / HANA / Gateway was used, but you may review this possibility in this post:

Former Member
0 Kudos

Hello All,

Similar to resource locking, is there way to achieve objects locking ? (i.e) If some one editing the PO in one session & the same PO should not be edited by some other person  in different session.

Thanks & Regards,

Rumeshbabu S

former_member193202
Participant
0 Kudos

and this is a very important topic. guess , someone is editing a PO wie statful App (sapgui,Webdynpro) and someone via stateless(fiori).

somehow there must be a mechanism to do such basic things??

i thinks only very few people outside sap do a lot with transactional apps in ui5, besides all a nice framework but comparing to webdnpro it is much more time-consuming to build "bigger" apps.

hopefulls web-ide will give us more features like we all know from the normal IDE's für sapgui and webdynpro/FPM especially.

ChandraMahajan
Active Contributor
0 Kudos

This is really good question and yes with SAP S/4 HANA delivering most of the UI in the form of Fiori based application, there will be need to support the scenario you mentioned with proper architecture.

earlier very good discussion happened in this thread

combination of optimistic lock concept + push notification etc can solve the problem to certain extent.

But also if you see this picture [Reference - http://hana.sap.com/content/dam/website/saphana/en_us/S4%20HANA/Final_Launch_S4HANA_Plattner.pdf], I am not very much clear with the point highlighted which talks about No locking,parallelism for throughput.

Not sure if this to-be design will solve the problem statement.

Regards,

Chandra

Message was edited by: Chandrashekhar Mahajan

former_member193202
Participant
0 Kudos

i read this thread already thanks a lot.

i hope there will be an easy-to-use solution. with s4 they say the frontend is fiori but as there is also the old-style erp in it (besides the new simplefinance,simplelogistics) etc. there must be still a lot of sapgui-transactions.

and for the transactional-world i think webdynpro will still a good solution, so there must be something in the direction "locking objects" over all "worlds".

but as i have not seen s4 only in announcements we have to wait and i think it will be take a long time until some customers will migrate ....but things get cooler