Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 29 JAN 2004 02:16:46PM Enrique Murphy wrote:

I want to develop a Web extension of a OI application, and I would like to receive some answers/advices on this subject. The documentation on the Works site is not enough to clarify the basic concepts of development.

After reading about and testing the OECGI and the new OEngine, I conclude the following:

- Every OECGI request always works associated with one and only one OEngine, no matter how the registry is configured. So, no matter if you use Dinamic or Persistent OEngine configurations on the registry, every OECGI request connects to OI with the same database and the same username. This means that two users accessing from two different internet browsers log into the OI with the same username, the name configured in the registry. The problems I have seen with this are related to locking:

  1. You can make a form that read and write to Linear Hash tables using the OECGI, but the locking does not work as in OI. When you read a record in OI, the form locks it. From a browser, a record only gets locked for update. I believe this must have been done because a user may simply close the browser, leaving the record locked. But this is a problem for our (and I think many other) applications, because if two users call the same record, modify it and save it, only the last modification will survive.
  1. I see that the SK is contempled in the Web Form, but the locking of it not. In OI, when you hit Enter to create a new record, other users cannot use the same SK you got, but this is not the same than if from two browsers hit Enter to create the (same) new record. Again, the last record saved will be the new record in the database.
This leads to two main questions:
1.1 Is it possible to start a new OEngine with a different username for different user's requests?. I mean, if I send a username in the html, may I create (from a Inet_xxx function) an OEngine with that username?. This is a key concept for me, because the application records the username in many tables, each time a record is modified.
1.2 In the case that it is possible the point 1.1, Will the locking work like in OI, or do I have to program my own locking mechanism?.

- If you use Dinamic OEngines, it is clear that each request is isolated, this is, starts the OEngine, processes the request, and close the OEngine. In the Persistent Engines, the documentation talks about the benefit of using commons "to store the engine state". What does it refer to with it?. Are those OI labelled commons?. I mean, may we use one OEngine per user, and initialize the labelled commons the first time the user logs in?.

Enrique

At 29 JAN 2004 03:11PM Bob Carten wrote:

Enrique:

First, take a look at JOI. It handles the locking for you.

If you are building robust windows with lots of validation and locking then JOI may be the way to go.

Second, OECGI out of the box manages just one user / application.

ZZCGI, a Sprezzatura tool, does more of what you want. Alternately, you can have your INET process use the rbasic CreateEngine function to start or connect to other engines as specific users.

Finally, you can use Xrev.dll or the RevCapi to write an object which starts engines directly from the webserver, without using CGI at all. Note that JOI can work through this same connection.

HTH

Bob

At 29 JAN 2004 05:02PM Enrique Murphy wrote:

Hi, Bob. Thanks again for the answers. Those are more or less the same solutions I was wondering about to solve this.

  1. I was testing JOI 2.2 but I didn't reach to the point of deploying a form to see the locking, so I was (erroneously) concluding that because it connected through OECGI it managed locking the same way as OECGI (i.e.,One user in one database).
  1. I also "cloned" the Inet_Formload from SYSPROG, and was modifying the clon to start an OEngine with a different user, but I have had no success with this yet. Would you give me some hint about the registry setting of OECGI and the params of CreateEngine and CreateQueue?. I was thinking about doing this:

Function Inet_FormLoad_Cloned(Request)

CreateEngine(EngineH,'\\SERVERNAME\PIPENAME',…

CreateQueue(QueueH,EngineH,,…

and then call the rest of the functions/Subroutines that the original Inet_FormLoad calls via CallFunction and CallSubroutine.

Would this simple change work?.

- I can't realise how could I write an object to directly start the engines from the webserver. Forgive my ignorance at this point.

Enrique

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/91e0d799d2c0d75085256e2a0069e7bd.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1