Forum Post: RE: transaction

Status
Not open for further replies.
S

sseney

Guest
James, My example shows that a share-lock record, upgrades to exclusive upon the update statment, then downgrades back to share-lock upon completion of the transaction. However, if you want the lock to be release you have to re-find the record as NO-LOCK or release the record - as the record scope is higher than the actual transaction. Yes, share-locks are evil...but we have legacy code, and this is how we've solved many of the "record lock" contentions over the years...as we don't have the time or manpower (or $$$ for consulting) to re-write our entire application. The initial question, I believe, was what lock would an exclusive lock downgrade to after a transaction. The answer can be dependent on how high the record scope is in relation to the transaction scope. If the record & transaction are at the same level - then once the record is out of scope - there is no more lock on it..right? Steph From: James Palmer [mailto:bounce-jdpjamesp@community.progress.com] Sent: Monday, April 14, 2014 1:46 PM To: TU.OE.General@community.progress.com Subject: RE: transaction RE: transaction Reply by James Palmer You should always specify what lock you want on a find. Share locks are evil. James Palmer | Application Developer Tel: 01253 785103 From: sseney Sent: ‎14/‎04/‎2014 17:09 To: TU.OE.General@community.progress.com Subject: RE: transaction RE: transaction Reply by sseney James, I know that if we have the following code structure: REPEAT: DO transaction: FIND FIRST table WHERE table.field1 = " some condition" NO-ERROR. IF AVAIL(table) THEN DO: disp field1 field2. update field2. END. END. FIND FIRST table WHERE table.field = "condition" NO-LOCK NO-ERROR. IF AVAIL(table) THEN DO: display field1 field2. PAUSE. END. END. table starts with share lock, upgrades to exclusive with transaction, then when we do a FIND ... NO-LOCK after the end of the transaction (explicit), the record is no longer in any lock status. Also, when the TRANSACTION ends the record would be downgraded to share lock. Maybe I didn't read the initial question well enough. I know that doing the release or find w/in the scope of the transaction will not do what I posted. But it does downgrade to share lock - after the scope of the transaction ends. Thus if you refind the record, or "release" the record, the share lock would not be held for the rest of the program. Steph From: James Palmer [mailto:bounce-jdpjamesp@community.progress.com] Sent: Monday, April 14, 2014 9:38 AM To: TU.OE.General@community.progress.com Subject: RE: transaction RE: transaction Reply by James Palmer Release does not do what you think it does. Refinding with a no-lock also does not do what you think it does. Stop receiving emails on this subject. Flag this post as spam/abuse. Stop receiving emails on this subject. Flag this post as spam/abuse. Click here to report this email as spam. Inenco group Ltd Petros House, St Andrews Road North, Lytham St Annes, Lancashire, FY8 2NF Company Reg No: 2435678 For further information on the Inenco Group Ltd please visit our web site at www.inenco.com NOTE: This email and any information contained within or attached in a separate file is confidential and intended solely for the Individual to whom it is addressed. The information or data included is solely for the purpose indicated or previously agreed. Any information or data included with this e-mail remains the property of Inenco Group Ltd. and the recipient will refrain from utilising the information for any purpose other than that indicated and upon request will destroy the information and remove it from their records. Whilst this e-mail or attached documents may contain market information, this information is not provided as advice. Inenco do not accept any liability for any damages or losses of any kind suffered as a result of any action(s) taken as a result of the content of this e-mail or attachments. Any views or opinions presented are solely those of the author and do not necessarily represent those of Inenco Group Ltd. If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. No warranties or assurances are made in relation to the safety and content of this e-mail and any attachments. No liability is accepted for any consequences arising from it. If you have received this email in error please notify the sender by telephone on +44 (0)1253 785000. Stop receiving emails on this subject. Flag this post as spam/abuse.

Continue reading...
 
Status
Not open for further replies.
Top