User/Groups Simple Read Only db Access

Existing single user db with mix of ORDA and ‘conventional’ constructs. Need to covert to multi-user with read only access for a group—using built-in 4D Users/Groups. Using global READ ONLY(*) works but errors are generated with Modify Selection, accept, etc. all through the db. Looking for a simple way, globally, without bracketing multiple instances of code with a test or duplicating forms. I hope I am missing a straight forward elegant solution. Newbe, and risking exposing my innocence. Also, is there an ORDA entity or entity selection attribute read only?

Thanks.

Hi,

You must take care of the record locking if you are using Classic Mode as well as in ORDA. 4D Classic record locking is different from ORDA.

I strongly suggest you to read the documentation and to do some testing in a small database with 2 process to try out how locking work in both approach :
4D Classic : https://doc.4d.com/4Dv17R4/4D/17-R4/Record-Locking.300-4054526.en.html
ORDA : https://doc.4d.com/4Dv17R4/4D/17-R4/Entity-locking.300-4085819.en.html

There is no such a thing like READ ONLY / READ WRITE in ORDA. ORDA use optimistic locking “by default” so any entity can be written without locking it. To be pessimistic and to lock an entity you must use the “lock()” member function.

In 4D Classic it is a good practice (I would say mandatory) to start every process with READ ONLY(*) and then use READ WRITE([Table]) …do something… READ ONLY([Table]) just for the time we need write access on a table. That way you will reduce the chance to lock record when you just need to read data.

Thanks Gabriel, now I understand how to proceed. I did not consider record locking and thus ‘best practice’ when developing this single user application - now multi-user. The articles you sited clearly articulate the locking behavior. These articles also suggest read only reduces client-sever traffic. Best all around.

Many thanks for your support and guidance.

-Greg