Page 1 of 1

ERROR WITH DBCLOSEALL()

Posted: Thu Aug 23, 2012 12:59 pm
by bobvolz
I have a complicated app that opens over 60 files and 70 or so indexes. I have no trouble opening these files and the application runs just fine. When the user exits the app they randomly get an error DBCLOSEALL() 'ERROR WHILE CLOSING A FILE'. I am on xBase 331 soon to be upgrading to SL 1. I have tried closing these files individually with FILENAME->(DBCLOSEAREA()) and the errors have slowed down a bit but I still get a few a day from my 200 or so users.
Has anyone experienced anything like this?. There is not much about this on the Alaska site so I guess either I am the only one having this problem or there is something wrong with my code.
Any help would be appreciated.
Bob Volz
Meadowland Systems
bvolz3850@aol.com

Re: ERROR WITH DBCLOSEALL()

Posted: Thu Aug 23, 2012 1:36 pm
by rdonnay
Bob -

The only time I have seen this kind of error was when there was a relation set between two databases.
dbCloseAll() will close databases in work area order.
If a relational database gets closed first, it can cause an IDSC with the parent database.
If you have relations set, make sure to clear them before closing the databases.

Roger

Re: ERROR WITH DBCLOSEALL()

Posted: Thu Aug 23, 2012 7:09 pm
by bobvolz
Hi Roger;
I don't set any relations. These are just dbfs opened with their indexes. The error does not appear on the same file. Usually there are still 30 or so files showing as opened. I thought I had a pattern with the error appearing on files that had
associated DBT files with it but that hasn't panned out either. I did notice on the error log that lists the files open that the record index numbers on the astericked file are way out of whack. For instance it may show a file opened that has 400 records in it but the index shows 3,000,000. Very weird. I'll send you a sample error log the next time it happens.
Thanks Bob Volz

Re: ERROR WITH DBCLOSEALL()

Posted: Thu Aug 23, 2012 10:39 pm
by Koverhage
Hi Bob,

I think Tom Liehr has a function named DbCloseAllSafe().
http://www.xbaseforum.de/viewtopic.php? ... &sk=t&sd=a

Maybe he can post this function here.

Re: ERROR WITH DBCLOSEALL()

Posted: Thu Aug 23, 2012 11:54 pm
by skiman
Hi Bob,
For instance it may show a file opened that has 400 records in it but the index shows 3,000,000. Very weird.
This seems as an index problem. I suppose your users are using Windows 7? I would try the SMB2 solution of Alaska.

Re: ERROR WITH DBCLOSEALL()

Posted: Fri Aug 24, 2012 5:01 am
by bobvolz
Hi Chris;

The error doesn't seem to be confined to Win 7 machines. I agree that it is probably some indexing issue. I use DBFNTX as do you if I recall.
I plan to migrate to SL1 this month. What exactly is the SMB2 solution.? I will look on the Alaska site for the dbcloseallsafe() function as well.
Thanks
Bob Volz

Re: ERROR WITH DBCLOSEALL()

Posted: Fri Aug 24, 2012 5:46 am
by skiman
Hi Bob,

The problem arises in networks with XP, Vista and Windows 7 in a mixed environment. According to the Alaska site it is for networks with Windows 2008 servers. If we have problems with indexes we always install the SMB2 solution, and up to now, the problem was solved each time.

http://www.alaska-software.com/fixes/smb2/overview.shtm

If you never use relations, you don't need a special close routine of function. However, it won't hurt. :)

This is my closing function.

Code: Select all

Function ABOCLoseAll()
***********************
LOCAL bError , aWorkareas , x, y

bError := ErrorBlock( {|e| Break(e)} )
aWorkAreas := workspacelist()
y := len(aWorkAreas)

for x = 1 to y
  BEGIN SEQUENCE
    (aWorkAreas[x])->(DbClearRelation())
    (aWorkAreas[x])->(DbCloseArea())
  ENDSEQUENCE
next
ErrorBlock(bError)
bError   := nil
Return nil

Re: ERROR WITH DBCLOSEALL()

Posted: Fri Aug 24, 2012 6:50 am
by bobvolz
Hi Chris;

I tried something similiar to that using an array created by workspacelist(). I didn't close the relations but I will try your function.
Thanks
Bob Volz