The App Server and the CRB
malkishtini
malkishtini at gmail.com
Sun Jun 21 11:09:51 EDT 2020
Hi Das,
To answer your question:
>> HOW do you issue one request at a time.. is there a way to do that
We are building another API in font of Omnis that will serve as a queue; It gets all the requests that are sent to Omnis, queue them and send them one by one to Omnis. It waits to get the response from Omnis before it send another request and so on.
Re- your other questions and concerns, you can check the email from Dough this AM, he has some positive feedback about using memory only file classes and CRB in remote tasks.
HTH,
Mayada
-----Original Message-----
From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Das Goravani
Sent: Sunday, June 21, 2020 12:19 AM
To: OmnisDev List - English
Subject: Re: The App Server and the CRB
Mayada, thanks for chiming in.. it helps me come to a concrete answer.. Doug has gone a long ways in saying that variables and hash’s are unique to each connection… but he hasn’t clarified if other types of variables namely those from file formats.. are covered in that uniqueness.. the Omnis support answer you cite tells me that there ARE field types that cannot be relied upon to be unique to each connection.. so I’m waiting to hear if these are file format fields.. used for data or as global variables.. my app is built up from the past.. from Omnis 7 coming forward.. to Studio but stayed the same used File Format Fields and the DF1 for data.. now converted to SQL, but still using the CRB for all calculations and manipulations.. wanting to go onto the App Server.. wondering how much conversion Im going to have to do.. so I am like your app that you are dealing with from Omnis 7.. have the same issues.. HOW do you issue one request at a time.. is there a way to do that.. I was under the impression that you were a victim to time slicing when you use the App Server.. that it decides where to break and turn to the next connection for a short spell, one slice, and then on to the next.. no this is not realistic in my case.. I will not have concurrent connections much at all.. my server will be hit by one person now and then.. very low light usage.. so maybe I dont need to worry about this right now.. as even if it is shared.. I dont have much of a sharing problem for quite some time.. I haven’t even begun yet.. I’m in the consideration stage.. prior to purchase.. trying to understand the product first..
> On Jun 20, 2020, at 8:31 PM, malkishtini <malkishtini at gmail.com> wrote:
>
> Hi,
>
> This is actually an interesting subject that is still puzzling to me.
> I just finished the work on adding an API to print an Omnis report in PDF format in an application that was developed in O7 and converted to studio as is (without reengineering), so the code still uses memory only file classes and CRB to build the lists that are used in the report.
> All the web apps and the ultra-thin clients that we have developed so far in Omnis are using instance and local vars..No web app was built before using global vars.
>
> So since I was not sure how global vars/CRBs will work with remotes tasks when multiple concurrent requests are made to the API with different params and how accurate the result will be, I sent a question to Omnis support with samples of my code(how the calls are done from the remote task to the other methods that are in different classes) and the way the lists are built using variable from different methods, and they answered me, the way I understood their answer was that it is better to issue one request at a time since we can't trust the variables that is loaded in the CRB at the time the code of the method is executed.
> Unless I misunderstood their response, that's my understanding to how global vars are handled when running in remote tasks.
> I hope I'm wrong in my understanding, since that will affect the way the ORA can be consumed in our case.
>
> The other thing that is not clear to me yet is the multi-threading in Omnis, if multiple requests are sent to the server one after the other from a single source, can Omnis handle all of them at the same time or there will be a delay, cause Omnis has to finish one request then process the next one? i.e. does Omnis App server (version 10) on Windows support multi-threading or not?
>
> Thank you,
> Mayada
>
> -----Original Message-----
> From: omnisdev-en [mailto:omnisdev-en-bounces at lists.omnis-dev.com] On Behalf Of Doug Easterbrook
> Sent: Saturday, June 20, 2020 8:05 PM
> To: OmnisDev List - English
> Subject: Re: The App Server and the CRB
>
> hi das:
>
> there is an interesting thing about serving web sites from omnis. Each of our connections instantiates a remote task. so I’m assuming what you are doing is ths.
>
> each remote task connection gets its own set of variables and they cannot be seen across threads.
>
> so, if you have two people connected, each one has its own CRB variables, hash variables, etc and you don’t have to worry about cross talk.
>
>
> one word of warning…
>
> it is possible to create a reference when you start a remote task that points back to the main task. we have done this to share database connections and a few other key bits of data that are somewhat static and don’t need to be read each time.
>
> if you do that.. and you’ve built some lists in your main omnis task, make sure you do not manipulate those lists or variables
>
> instead, COPY them to a local copy and manipulate the local copy. that way you wont have some surprizing results
>
>
>
> eg.
>
> in the main task
>
> creates a list called ‘Months’ that contain 12 rows with values Jan to dec.
>
>
>
> in the Remote task
>
> this cannot see the list called ‘Months’. but you can set a reference back to the main task to get the list
>
> reg. set reference Localtaskref to $tasks.Main.$ref
>
> calculate localMonths as taskref.$getMonthList
>
>
>
> now you have copied the Months list to a variable called localMonths. and you are safe
>
>
> if, instead, you manipulated Months and set the value to the row for dec …. another remote task could change it to august on you… and you wouldn't know.
>
>
>
>
>
>
> for a recap:
>
> 1) crb vars and #hash variables are distinct for each remote task
>
> 2) you can refer to common variables via the main task to get constants .. but don’t manipulate that data in the main task from the remote task. copy the data instead.
>
>
>
> hope that helps.
>
>
>
>
>
> Doug Easterbrook
> Arts Management Systems Ltd.
> mailto:doug at artsman.com
> http://www.artsman.com
> Phone (403) 650-1978
>
>> On June 20, 2020, at 2:35 PM, Das Goravani <das at Goravani.com> wrote:
>>
>>
>> Hello
>>
>> I’m trying to understand the difference between the CRB and using rows to hold data in the App Server.
>>
>> Say you have a chunk of code, big, that does one thing.. in my case an astrological chart and readings.. then another big chunk of code and reports that creates a PDF output. You want these online.. using the App Server.. so that people can get astrological reports.
>>
>> Using the App Server.. say one persons code is running.. and their time slice ends.. the next person in the que starts to run and overwrites the values in the CRB with new ones.. bad.. I’m led to believe presently that is what happens.. that the CRB is shared between users..
>>
>> And people said therefore you have to use ROWS and reference them rather than fields from file formats.. but rows and lists are ALSO in the CRB and subject to being written over aren’t they?
>>
>> Or is it that what’s meant is to use an object for all your code.. and variables.. and then OBJECTS INSTANTIATE FOR EACH USER????
>>
>> Do they?
>>
>> How do you get your rows and lists to NOT be overwritten just as the CRB is.. ???
>>
>> If you widen the time slice so that there’s enough time for it to finish the part that is in the CRB do you think that is viable as a way?
>>
>> It would be a really huge task to convert all my code in those two chunks to being all rows and lists holding data and references to them in all code..
>>
>> I’m thinking of putting my astrology readings online.. thinking of using the app server.. if I kick off users that hasn’t budged in 5 minutes maybe I can keep the number of users down.. and affordable.. the unlimited users price tag is a bit high for me at like 14 K … wish I could do it.. then I wouldn’t have to kick off users..
>>
>> This note is about how does rows do better than the CRB in terms of keeping users data separate on the app server.. that is really the question..
>>
>> Das
>> _____________________________________________________________
>> Manage your list subscriptions at http://lists.omnis-dev.com Start a
>> new message -> mailto:omnisdev-en at lists.omnis-dev.com
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
_____________________________________________________________
Manage your list subscriptions at http://lists.omnis-dev.com
Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list