Record Locking Postgres
dlr at futurechalk.com
dlr at futurechalk.com
Sun Jul 3 20:53:31 UTC 2022
Hello Das,
I use an object to do all my transaction management which does work in both desktop and java script forms. As Rudolf mentioned you have to have a balance. I have chosen that all transactions are done in the lease restrictive way by using auto commit transactions until it is time to update and execute the commands under a manual transaction. In this manual transaction I use either the timestamp or and update count to determine if the data has been changed since I last read the record. If the result is that the timestamp has changed I give the user a message line ‘Data has changed please try again’ and at that point rollback and switch back to auto commit mode again.
I have had to adjust workflow when the transactions (Unit of Work) has been very complex and the locks were being held to long.
This topic is very complex and takes awhile to really understand how ACID compliance works in each database. Each database also has different ways of maximizing concurrency.
Sincerely,
Dan Ridinger
> On Jul 3, 2022, at 10:28 AM, Das Goravani <goravanis at gmail.com> wrote:
>
>
>
>> On Jul 3, 2022, at 12:51 PM, dlr at futurechalk.com wrote:
>>
>> I use a standard set of routines to manage transactions in Omnis
>
> Dear Dan,
>
> When converting my astrology app to SQL, I made a set of routines that mimicked the Omnis data handling commands for the Datafiles. This worked out very well. I put the routines into the Table Superclass. I call an object that has the beginnings of the methods inside it.. here I would define the list from a SQL class.. this connected a Table Class which has the rest of the methods in it. I then would transfer from the Object to the Table class to finish the method. This may have been unnecessarily complex. I might have done just as well doing the whole method in the object. Since the Javascript Client only allows instance variables in fields on the form, or columns from an instance variable row, so your data is really locked in the form.. I’m not sure at this point if I could move the data from the form to say a Task Var Row so that the object containing centralized method would have access to the data being saved. I digress a bit here. Since your data with forms is locked in the form in instance variables, before calling a method in an object which attempts to save that data I envision one would have to copy the data to a Task Variable row that the object then has access to. Does this sound reasonable?
>
> Where do you put your centralized methods? In an object, a Table, or where?
>
> Can you use standard Objects when working the Javascript Client? (Said another way, do Remote Objects mean that standard objects cannot be used with the Javascript Client?) I’m assuming you CAN use normal Objects when working with Remote Forms.
>
> What do your calls to your centralized data handling methods look like?
>
> Is it:
>
> Do MyTaskVarObject.$MethodName(param1, param2…)
>
> Thanks
>
> Das
>
> _____________________________________________________________
> Manage your list subscriptions at https://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list