Hi to everyone!
I have a little problem when reading the _Locks table.
I have an window that display the users list (taht hold locks) in one browser, when selecting a user it display the _Lock table for that user.
Everything is loaded in temp-table. But sometimes, it look like Progress hang while doing the Find first _Lock...!
And then, once i have the _Lock record with the RECID, i want to display the record itself in another browser. This part is ok when i can get the _Lock browser filled.
someone have any ideas why it look like it hang doing the find first.
Is it because the process that the user is running has more than 512 locks ????
Because when i try it, the process that was generating the locks was really big, locking a lot of records and i know that _Lock don't have any index on RECID field.
Thanks a lot!
Here's the procedure code:
Procedure pLoadLockInfo
I have a little problem when reading the _Locks table.
I have an window that display the users list (taht hold locks) in one browser, when selecting a user it display the _Lock table for that user.
Everything is loaded in temp-table. But sometimes, it look like Progress hang while doing the Find first _Lock...!
And then, once i have the _Lock record with the RECID, i want to display the record itself in another browser. This part is ok when i can get the _Lock browser filled.
someone have any ideas why it look like it hang doing the find first.
Is it because the process that the user is running has more than 512 locks ????
Because when i try it, the process that was generating the locks was really big, locking a lot of records and i know that _Lock don't have any index on RECID field.
Thanks a lot!
Here's the procedure code:
Procedure pLoadLockInfo
DEF INPUT PARAMETER pUserLockID AS INT NO-UNDO.
/****************************************************************************/
DEF VAR i# AS INT NO-UNDO.
CLOSE QUERY brwLock.
fStatus:SCREEN-VALUE IN FRAME frmBottom = "Deleting temp table.".
EMPTY TEMP-TABLE ttLock.
fStatus:SCREEN-VALUE = "Loading locks information of the selected USER... Please wait...".
SESSION:SET-WAIT-STATE("GENERAL").
FIND FIRST _UserLock WHERE _UserLock._UserLock-Id = pUserLockID NO-LOCK NO-ERROR.
IF AVAIL _UserLock THEN DO:
fStatus:SCREEN-VALUE = "Opening query.".
OPEN QUERY brwLock FOR EACH ttLock NO-LOCK.
fStatus:SCREEN-VALUE = "".
SESSION:SET-WAIT-STATE("").
END PROCEDURE.MESSAGE "begin loop" VIEW-AS ALERT-BOX. /*Yanick*/
ExtLoop:
DO i# = 1 TO 512:
END. /* if avail _UserLock */IF (_UserLock._UserLock-Chain[i#] <> ? OR _UserLock._UserLock-Recid[i#] <> ?) AND
(_UserLock._UserLock-Type[i#] <> ? OR _UserLock._UserLock-Flags[i#] <> ?) THEN DO:
END.
END. /* do i# = 1 to 512 *//* link to find lock information on the record itself */
FIND FIRST _Lock WHERE _Lock._Lock-ID <> ? AND _Lock._Lock-RecID = _UserLock._UserLock-RecID[i#] AND _Lock._Lock-chain = _UserLock._UserLock-Chain[i#] NO-LOCK NO-WAIT.
IF AVAIL _Lock THEN DO:
/* look for table name */
FIND FIRST _File WHERE _File._File-number = _Lock._Lock-table NO-LOCK NO-WAIT.
IF AVAIL _File THEN DO:
END. /* avail _Lock */CREATE ttLock.
ASSIGN ttLock.ttLockID = _Lock._Lock-Id
ttLock.ttRecid = _Lock._Lock-Recid
ttLock.ttChain = _Lock._Lock-chain
ttLock.ttTableName = _File._File-name
ttLock.ttLockFlags = _Lock._Lock-flags
ttLock.ttLockType = _Lock._Lock-type.
END. /* avail _File */
fStatus:SCREEN-VALUE = "Opening query.".
OPEN QUERY brwLock FOR EACH ttLock NO-LOCK.
fStatus:SCREEN-VALUE = "".
SESSION:SET-WAIT-STATE("").