ERROR WITH DBCLOSEALL()

This forum is for general support of Xbase++
Post Reply
Message
Author
bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

ERROR WITH DBCLOSEALL()

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4729
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ERROR WITH DBCLOSEALL()

#2 Post 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
The eXpress train is coming - and it has more cars.

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: ERROR WITH DBCLOSEALL()

#3 Post 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

Koverhage
Posts: 151
Joined: Mon Feb 01, 2010 8:45 am

Re: ERROR WITH DBCLOSEALL()

#4 Post 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.
Klaus

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: ERROR WITH DBCLOSEALL()

#5 Post 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.
Best regards,

Chris.
www.aboservice.be

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: ERROR WITH DBCLOSEALL()

#6 Post 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

skiman
Posts: 1185
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: ERROR WITH DBCLOSEALL()

#7 Post 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
Best regards,

Chris.
www.aboservice.be

bobvolz
Posts: 114
Joined: Sun Jan 31, 2010 11:25 am

Re: ERROR WITH DBCLOSEALL()

#8 Post 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

Post Reply