Alaska Software Inc. - System Freezing Because Of Locked Tables?
Username: Password:
AuthorTopic: System Freezing Because Of Locked Tables?
Scott KriseSystem Freezing Because Of Locked Tables?
on Thu, 29 Apr 2021 08:50:44 -0400
Hello Everyone,

So I have been having an on-going intermittent issue where during an update, 
the system just freezes. I have record locking logic in place that lets 
users know when a record is locked, but in these cases, no messages are 
being displayed. In the most recent case, a user was doing similar processes 
on multiple parts. She froze while doing the first transaction on part 
A...she was forced to do an end-task after a enough time had elapsed where 
there was no hope of it completing, she then went back into the system and 
did the same transaction on Part B, and it locked up again. So this tells me 
the entire file is being locked...not just the record, and the error 
trapping I have in place is not recognizing it as a lock.

Has anyone ever seen this type of issue? Any suggestions on how to resolve? 
I've tested both record and file locks, and under normal situations, my 
error trapping does give a message to the user....so I know that is working 
properly.

FYI I use dbf/ntx tables.

Thanks,

Scott
Andreas Gehrs-Pahl
Re: System Freezing Because Of Locked Tables?
on Thu, 29 Apr 2021 18:11:57 -0400
Scott,

>She froze while doing the first transaction on part 
>A...she was forced to do an end-task after a enough time had elapsed where 
>there was no hope of it completing, she then went back into the system and 
>did the same transaction on Part B, and it locked up again.

Did she (or your program by itself) re-index after that abort? If not, then 
the problem would not be fixed if it was index-related. If the "end-task" is 
something they do (often), a full re-index after that should be mandatory!

>So this tells me the entire file is being locked...not just the record, 
>and the error trapping I have in place is not recognizing it as a lock.

I don't think that the file or any record is necessarily locked at all. It 
is more likely that a simple (common) index corruption causes that freezing.

>Has anyone ever seen this type of issue? Any suggestions on how to resolve? 

I would suggest an automatic or semi-automatic re-indexing procedure, or an 
operating rule for the customer to always re-index all files, after a non-
normal program termination. When I did a lot of customer support, the first 
thing I asked was: Have you re-indexed? If they hadn't, re-indexing solved 
the issues in probably 70% of all cases.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Scott KriseRe: System Freezing Because Of Locked Tables?
on Wed, 05 May 2021 12:03:48 -0400
Hi Andreas,

No...no re-index was done following the abnormal transaction. Unfortunately, 
my reindexing process requires to have all users exit the system, and that’s 
not always feasible.

So the strange thing is that the problem goes away without a reindex...and 
if there were some sort of index corruption, I'd assume you'd need a reindex 
to correct...but that is never the case. My goto troubleshooting step when 
these "mystery lockups" occur is to see who is currently has the suspected 
table open and just go have them exit the software and go back in. At some 
point during that process, when the correct user logs out, the issue goes 
away.

This particular system is the most heavily used of the ones I have written 
(maybe 30-40 concurrent users on average), and I feel like its some sort of 
collision or corruption, but I don’t currently have any way to handle it 
within the error checking I have available.

"Andreas Gehrs-Pahl" wrote in message 
news:1ddbvi8ih809z.fiqkfkt9pkc0.dlg@40tude.net...

Scott,

>She froze while doing the first transaction on part
>A...she was forced to do an end-task after a enough time had elapsed where
>there was no hope of it completing, she then went back into the system and
>did the same transaction on Part B, and it locked up again.

Did she (or your program by itself) re-index after that abort? If not, then
the problem would not be fixed if it was index-related. If the "end-task" is
something they do (often), a full re-index after that should be mandatory!

>So this tells me the entire file is being locked...not just the record,
>and the error trapping I have in place is not recognizing it as a lock.

I don't think that the file or any record is necessarily locked at all. It
is more likely that a simple (common) index corruption causes that freezing.

>Has anyone ever seen this type of issue? Any suggestions on how to resolve?

I would suggest an automatic or semi-automatic re-indexing procedure, or an
operating rule for the customer to always re-index all files, after a non-
normal program termination. When I did a lot of customer support, the first
thing I asked was: Have you re-indexed? If they hadn't, re-indexing solved
the issues in probably 70% of all cases.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Andreas Gehrs-Pahl
Re: System Freezing Because Of Locked Tables?
on Wed, 05 May 2021 21:19:05 -0400
Scott,

>This particular system is the most heavily used of the ones I have written 
>(maybe 30-40 concurrent users on average), and I feel like its some sort of 
>collision or corruption, but I donʼt currently have any way to handle it 
>within the error checking I have available.

Using 30-40 concurrent users is probably a big part of the issue. With 
directly opened data tables and index files, you might run into issues with 
as few as 10 users. Anything over 20 would definitively warrant a client 
server setup, such as ADS (Advantage Database Server) or even Alaska's 
PGSDBE (PostGreSQL with ISAM emulation).

If it isn't index corruption, it could also be index locking. Any record 
pointer movement with (one or more) open index files will result in implicit 
index file locking. Depending on your DBE setting, that might lead to 
dead-locks or race conditions, when (too) many users or applications 
concurrently access those tables and index files.

There is no Xbase++ feature or function available to determine if an 
(implicit) index locking has occurred or if (and where) there is a dead 
lock situation somewhere. 

If you post your DBE settings, we could take a look, in case there are some 
issues. But even if your DBE settings are optimized for your situation, it 
might still be worthwhile to look into a client server setup.

Hope that helps,

Andreas

Andreas Gehrs-Pahl
Absolute Software, LLC

phone: (989) 723-9927
email: Andreas@AbsoluteSoftwareLLC.com
web:   http://www.AbsoluteSoftwareLLC.com
[L]:   https://www.LinkedIn.com/in/AndreasGehrsPahl
[F]:   https://www.FaceBook.com/AbsoluteSoftwareLLC
Carlos A Beling Re: System Freezing Because Of Locked Tables?
on Wed, 05 May 2021 13:20:41 -0300
Hi Scott.
Good day.
I make a commit after each one update and I am not having these issues.

Fraternally
Beling

On 29/04/2021 09:50, Scott Krise wrote:
> Hello Everyone,
> 
> So I have been having an on-going intermittent issue where during an 
> update, the system just freezes. I have record locking logic in place 
> that lets users know when a record is locked, but in these cases, no 
> messages are being displayed. In the most recent case, a user was doing 
> similar processes on multiple parts. She froze while doing the first 
> transaction on part A...she was forced to do an end-task after a enough 
> time had elapsed where there was no hope of it completing, she then went 
> back into the system and did the same transaction on Part B, and it 
> locked up again. So this tells me the entire file is being locked...not 
> just the record, and the error trapping I have in place is not 
> recognizing it as a lock.
> 
> Has anyone ever seen this type of issue? Any suggestions on how to 
> resolve? I've tested both record and file locks, and under normal 
> situations, my error trapping does give a message to the user....so I 
> know that is working properly.
> 
> FYI I use dbf/ntx tables.
> 
> Thanks,
> 
> Scott