Locking only in trans mode, thanks to IT & Bastiaan, Identifying Integers
Das Goravani
das at goravani.com
Mon Jan 22 15:45:22 EST 2018
Well this is a hoop to jump through but if that’s the way it is then that’s what I’ll do. I do understand what youre saying and doing here, this way, matches what I was thinking in terms of when to issue commands, the Select..For Update Before you enter data to lock the record
So when there’s a CANCEL to the enter data…nothing has been sent to the server, so there’s nothing to rollback, correct ? And how do the locks get cancelled on a Cancel to enter data.. by undoing the Transaction mode command?
Thank you IT for your very helpful answer. Thanks to Bastiaan for his as well.
Bastiaan, you mentioned something regarding Table Classes. I was thinking up til now, and still, that I can avoid using them… the manuals say you really only need to use them to override the standard methods they have inside them, which I dont need to do at this point, that I’m aware of, or do you just need to use for various reasons when you’re serious about all this stuff? I want to get off on the correct footing.. I thought I could skip table classes but that sometimes I would need query classes when doing two tables at once into a list…
There’s another thing.. in order to lock 2 records say, customer and invoice, that come from two different tables, I’m thinking I have to select each with a Prepare for Update (Select..For Update) commands… i hope it doesn’t tell me I cannot issue a second one.. I dont know how to select two records from two tables with one select command… i have unique fields with a simple integar in them for identity… my way is to have a table that is only for "Giving out numbers", it keeps track on the number, increments itself when one is taken out, and saves, just a very small definition, just 3 fields, mainly 2, the third is name of table it serves, 4 records for 4 types of number needs, customers, invoices, products, and representatives, so far… in future more parent type files will require making a record for number check out for them… these number check out records are the most accessed records in the database… a very quick lock and number grab during saving of a main record. I dont know of any other way to do it without risking duplicates, and being impervious to export import… mine is impervious… just check in startup construct for the records to be holding one digit higher than highest record holds.. easy.. to ensure correct dispensation.
I think it’s great that there is this email list, I think that the knowers who answer are very magnanimous, kind. I hope to be an answer giver myself someday. I’m magnanimous too, by nature.
> On Jan 22, 2018, at 10:20 AM, IT <it at plastipol.com> wrote:
>
> Hi Das
>
> SELECT … FOR UPDATE locks records in transaction mode, otherwise only selects the record
> So you need to do something like this:
>
>
> Do $cinst.$sessionobject.$transactionmode.$assign(kSessionTranManual)
> Do $cinst.$sessionobject.$begin() Returns #F
> select … for update
> enter data
> if flag true
> update ...
> Do $cinst.$sessionobject.$commit
> Do $cinst.$sessionobject.$transactionmode.$assign(kSessionTranAutomatic)
> else
> Do $cinst.$sessionobject.$rollback
> Do $cinst.$sessionobject.$transactionmode.$assign(kSessionTranAutomatic)
> end if
>
>
>
>> El 22/1/2018, a las 4:30, Das Goravani <das at goravani.com> escribió:
>>
>> I would like to read the use of that command, $definefromSQLclass… if you can post it for me, just one line of code, i need to see what precedes it, how it’s used, syntax, example basically. Similarly for the one called $prepareforupdate as i assume that locks records since it issues a SELECT .. FOR UPDATE command which I was told locks records
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
Das Goravani
das at goravani.com
http://www.Goravani.com <http://www.youtube.com/profile?user=RichardEdwardWurst>
<http://www.youtube.com/RichardEdwardWurst>http://www.YouTube.com <http://www.youtube.com/>/RichardEdwardWurst
http://www.YouTube.com/DasGoravani <http://www.youtube.com/DasGoravani>
http://YouTube.com/JyotishStudio <http://youtube.com/JyotishStudio>
More information about the omnisdev-en
mailing list